Post direct status test
This commit is contained in:
parent
2ce48c1a42
commit
987a52cf6f
1 changed files with 16 additions and 0 deletions
|
@ -124,6 +124,22 @@ test "posting a sensitive status", %{conn: conn} do
|
|||
assert Repo.get(Activity, id)
|
||||
end
|
||||
|
||||
test "posting a direct status", %{conn: conn} do
|
||||
user1 = insert(:user)
|
||||
user2 = insert(:user)
|
||||
content = "direct cofe @#{user2.nickname}"
|
||||
|
||||
conn =
|
||||
conn
|
||||
|> assign(:user, user1)
|
||||
|> post("api/v1/statuses", %{"status" => content,
|
||||
"visibility" => "direct"})
|
||||
|
||||
assert %{"content" => content, "id" => id, "visibility" => "direct"} = json_response(conn, 200)
|
||||
assert activity = Repo.get(Activity, id)
|
||||
assert user2.follower_address not in activity.data["to"]
|
||||
end
|
||||
|
||||
test "replying to a status", %{conn: conn} do
|
||||
user = insert(:user)
|
||||
|
||||
|
|
Loading…
Reference in a new issue