Add some tests

Also add a unicity constraint on the followers table

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-08-03 10:16:22 +02:00
parent 115d1d1a3e
commit e1e9b0fc11
9 changed files with 157 additions and 16 deletions

View File

@@ -115,5 +115,18 @@ defmodule EventosWeb.ActorControllerTest do
"role" => 0
}
end
test "join non existent group", %{conn: conn, user: user, actor: actor} do
conn = auth_conn(conn, user)
conn =
post(conn, group_path(conn, :join, "mygroup@nonexistent.tld"), %{
"actor_name" => actor.preferred_username
})
resp = json_response(conn, 404)
assert resp = %{msg: "Resource not found", details: "group or actor doesn't exist"}
end
end
end