Update tests
This commit is contained in:
parent
406cd1798c
commit
c30541830f
10 changed files with 134 additions and 284 deletions
|
@ -1,52 +1,8 @@
|
|||
defmodule NullaWeb.OutboxControllerTest do
|
||||
use NullaWeb.ConnCase
|
||||
alias Nulla.KeyGen
|
||||
alias Nulla.Snowflake
|
||||
alias Nulla.Models.Actor
|
||||
alias Nulla.Models.Note
|
||||
|
||||
setup do
|
||||
{publicKeyPem, _privateKeyPem} = KeyGen.gen()
|
||||
|
||||
{:ok, actor} =
|
||||
Actor.create_actor(%{
|
||||
domain: "localhost",
|
||||
ap_id: "http://localhost/users/test",
|
||||
type: "Person",
|
||||
following: "http://localhost/users/test/following",
|
||||
followers: "http://localhost/users/test/followers",
|
||||
inbox: "http://localhost/users/test/inbox",
|
||||
outbox: "http://localhost/users/test/outbox",
|
||||
featured: "http://localhost/users/test/collections/featured",
|
||||
featuredTags: "http://localhost/users/test/collections/tags",
|
||||
preferredUsername: "test",
|
||||
name: "Test",
|
||||
summary: "Test User",
|
||||
url: "http://localhost/@test",
|
||||
manuallyApprovesFollowers: false,
|
||||
discoverable: true,
|
||||
indexable: true,
|
||||
published: DateTime.utc_now(),
|
||||
memorial: false,
|
||||
publicKey:
|
||||
Jason.OrderedObject.new(
|
||||
id: "http://localhost/users/test#main-key",
|
||||
owner: "http://localhost/users/test",
|
||||
publicKeyPem: publicKeyPem
|
||||
),
|
||||
endpoints: Jason.OrderedObject.new(sharedInbox: "http://localhost/inbox")
|
||||
})
|
||||
|
||||
note_id = Snowflake.next_id()
|
||||
|
||||
{:ok, _note} =
|
||||
Note.create_note(%{
|
||||
url: "#{actor.url}/#{note_id}",
|
||||
content: "Hello World from Nulla!",
|
||||
language: "en",
|
||||
actor_id: actor.id
|
||||
})
|
||||
|
||||
Nulla.Fixtures.Data.create()
|
||||
:ok
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue