From a0c5b42e293959c7bc448f171fc38c2c26f91d18 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Mon, 28 May 2018 17:51:50 +0000 Subject: [PATCH] tests: assert the state prior to mutating it as well as afterward --- test/web/mastodon_api/mastodon_api_controller_test.exs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index e45b5c9c2..d1812457d 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -652,6 +652,11 @@ test "/api/v1/follow_requests works" do {:ok, activity} = ActivityPub.follow(other_user, user) + user = Repo.get(User, user.id) + other_user = Repo.get(User, other_user.id) + + assert User.following?(other_user, user) == false + conn = build_conn() |> assign(:user, user) @@ -667,6 +672,11 @@ test "/api/v1/follow_requests/:id/authorize works" do {:ok, activity} = ActivityPub.follow(other_user, user) + user = Repo.get(User, user.id) + other_user = Repo.get(User, other_user.id) + + assert User.following?(other_user, user) == false + conn = build_conn() |> assign(:user, user)