Fix specs.
This commit is contained in:
parent
44295dd49a
commit
0c871e5c6e
|
@ -91,7 +91,7 @@ test "get a status", %{conn: conn} do
|
||||||
|> get("/api/v1/statuses/#{activity.id}")
|
|> get("/api/v1/statuses/#{activity.id}")
|
||||||
|
|
||||||
assert %{"id" => id} = json_response(conn, 200)
|
assert %{"id" => id} = json_response(conn, 200)
|
||||||
assert id == activity.id
|
assert id == to_string(activity.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "deleting a status" do
|
describe "deleting a status" do
|
||||||
|
@ -132,7 +132,7 @@ test "reblogs and returns the reblogged status", %{conn: conn} do
|
||||||
|> post("/api/v1/statuses/#{activity.id}/reblog")
|
|> post("/api/v1/statuses/#{activity.id}/reblog")
|
||||||
|
|
||||||
assert %{"id" => id, "reblogged" => true, "reblogs_count" => 1} = json_response(conn, 200)
|
assert %{"id" => id, "reblogged" => true, "reblogs_count" => 1} = json_response(conn, 200)
|
||||||
assert activity.id == id
|
assert to_string(activity.id) == id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ test "favs a status and returns it", %{conn: conn} do
|
||||||
|> post("/api/v1/statuses/#{activity.id}/favourite")
|
|> post("/api/v1/statuses/#{activity.id}/favourite")
|
||||||
|
|
||||||
assert %{"id" => id, "favourites_count" => 1, "favourited" => true} = json_response(conn, 200)
|
assert %{"id" => id, "favourites_count" => 1, "favourited" => true} = json_response(conn, 200)
|
||||||
assert activity.id == id
|
assert to_string(activity.id) == id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ test "unfavorites a status and returns it", %{conn: conn} do
|
||||||
|> post("/api/v1/statuses/#{activity.id}/unfavourite")
|
|> post("/api/v1/statuses/#{activity.id}/unfavourite")
|
||||||
|
|
||||||
assert %{"id" => id, "favourites_count" => 0, "favourited" => false} = json_response(conn, 200)
|
assert %{"id" => id, "favourites_count" => 0, "favourited" => false} = json_response(conn, 200)
|
||||||
assert activity.id == id
|
assert to_string(activity.id) == id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ test "gets a users statuses", %{conn: conn} do
|
||||||
|
|
||||||
assert [%{"id" => id}] = json_response(conn, 200)
|
assert [%{"id" => id}] = json_response(conn, 200)
|
||||||
|
|
||||||
assert id == note_two.id
|
assert id == to_string(note_two.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ test "hashtag timeline", %{conn: conn} do
|
||||||
|
|
||||||
assert [%{"id" => id}] = json_response(conn, 200)
|
assert [%{"id" => id}] = json_response(conn, 200)
|
||||||
|
|
||||||
assert id == activity.id
|
assert id == to_string(activity.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "getting followers", %{conn: conn} do
|
test "getting followers", %{conn: conn} do
|
||||||
|
@ -351,7 +351,7 @@ test "search", %{conn: conn} do
|
||||||
assert results["hashtags"] == []
|
assert results["hashtags"] == []
|
||||||
|
|
||||||
[status] = results["statuses"]
|
[status] = results["statuses"]
|
||||||
assert status["id"] == activity.id
|
assert status["id"] == to_string(activity.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "search fetches remote accounts", %{conn: conn} do
|
test "search fetches remote accounts", %{conn: conn} do
|
||||||
|
@ -377,6 +377,6 @@ test "returns the favorites of a user", %{conn: conn} do
|
||||||
|> get("/api/v1/favourites")
|
|> get("/api/v1/favourites")
|
||||||
|
|
||||||
assert [status] = json_response(conn, 200)
|
assert [status] = json_response(conn, 200)
|
||||||
assert status["id"] == activity.id
|
assert status["id"] == to_string(activity.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -365,7 +365,7 @@ test "fetches a user by uri" do
|
||||||
{:ok, represented} = TwitterAPI.get_external_profile(user, id)
|
{:ok, represented} = TwitterAPI.get_external_profile(user, id)
|
||||||
remote = User.get_by_ap_id(id)
|
remote = User.get_by_ap_id(id)
|
||||||
|
|
||||||
assert represented == UserView.render("show.json", %{user: remote, for: user})
|
assert represented["id"] == UserView.render("show.json", %{user: remote, for: user})["id"]
|
||||||
|
|
||||||
# Also fetches the feed.
|
# Also fetches the feed.
|
||||||
assert Activity.get_create_activity_by_object_ap_id("tag:mastodon.social,2017-04-05:objectId=1641750:objectType=Status")
|
assert Activity.get_create_activity_by_object_ap_id("tag:mastodon.social,2017-04-05:objectId=1641750:objectType=Status")
|
||||||
|
|
Loading…
Reference in a new issue