New generate config task from Pleroma upstream & move tasks namespace

Little fixes and tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-01-03 11:34:31 +01:00
parent 6885c73aa8
commit 8d943f950f
10 changed files with 229 additions and 149 deletions

View File

@@ -729,8 +729,7 @@ defmodule Mobilizon.Service.ActivityPub.TransmogrifierTest do
{:ok, activity} = MobilizonWeb.API.Comments.create_comment(actor.preferred_username, "hey")
{:ok, modified} = Transmogrifier.prepare_outgoing(activity.data)
assert modified["@context"] ==
Mobilizon.Service.ActivityPub.Utils.make_json_ld_header()["@context"]
assert modified["@context"] == Utils.make_json_ld_header()["@context"]
end
test "it sets the 'attributedTo' property to the actor of the object if it doesn't have one" do

View File

@@ -22,12 +22,12 @@ defmodule MobilizonWeb.WebFingerTest do
test "GET /.well-known/webfinger with local actor", %{conn: conn} do
%Actor{preferred_username: username} = actor = insert(:actor)
conn = get(conn, "/.well-known/webfinger?resource=acct:#{username}@localhost:4001")
conn = get(conn, "/.well-known/webfinger?resource=acct:#{username}@mobilizon.test")
assert json_response(conn, 200) == WebFinger.represent_actor(actor)
end
test "GET /.well-known/webfinger with non existent actor", %{conn: conn} do
conn = get(conn, "/.well-known/webfinger?resource=acct:notme@localhost:4001")
conn = get(conn, "/.well-known/webfinger?resource=acct:notme@mobilizon.test")
assert response(conn, 404) == "Couldn't find user"
end

View File

@@ -1,11 +1,10 @@
defmodule MobilizonWeb.Resolvers.CommentResolverTest do
use MobilizonWeb.ConnCase
alias Mobilizon.{Events, Actors}
alias Mobilizon.Actors
alias Mobilizon.Actors.{Actor, User}
alias MobilizonWeb.AbsintheHelpers
import Mobilizon.Factory
@comment %{text: "some body"}
@comment %{text: "I love this event"}
setup %{conn: conn} do
{:ok, %User{default_actor: %Actor{} = actor} = user} =
@@ -16,12 +15,10 @@ defmodule MobilizonWeb.Resolvers.CommentResolverTest do
describe "Comment Resolver" do
test "create_comment/3 creates a comment", %{conn: conn, actor: actor, user: user} do
category = insert(:category)
mutation = """
mutation {
createComment(
text: "I love this event",
text: "#{@comment.text}",
actor_username: "#{actor.preferred_username}"
) {
text,
@@ -35,7 +32,7 @@ defmodule MobilizonWeb.Resolvers.CommentResolverTest do
|> auth_conn(user)
|> post("/api", AbsintheHelpers.mutation_skeleton(mutation))
assert json_response(res, 200)["data"]["createComment"]["text"] == "I love this event"
assert json_response(res, 200)["data"]["createComment"]["text"] == @comment.text
end
end
end