tests: assert the state prior to mutating it as well as afterward
authorWilliam Pitcock <nenolod@dereferenced.org>
Mon, 28 May 2018 17:51:50 +0000 (17:51 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Mon, 11 Jun 2018 22:15:53 +0000 (22:15 +0000)
test/web/mastodon_api/mastodon_api_controller_test.exs

index e45b5c9c26e1ca50bcd0efb7d147916ecff7bfe1..d1812457dd27b9dcc899e8dc7d404c8401d0b0cb 100644 (file)
@@ -652,6 +652,11 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest 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 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest 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)