expunge: decrement user favorite counts.

This commit is contained in:
evazion
2017-08-03 22:45:10 -05:00
committed by r888888888
parent fd9dc6f647
commit af42740ca9
3 changed files with 11 additions and 15 deletions

View File

@@ -80,6 +80,13 @@ class PostTest < ActiveSupport::TestCase
end
end
should "decrement the user's favorite count" do
@post.add_favorite!(@post.uploader)
assert_difference(["@post.uploader.reload.favorite_count"], -1) do
@post.expunge!
end
end
should "remove the post from iqdb" do
mock_iqdb_service!
Post.iqdb_sqs_service.expects(:send_message).with("remove\n#{@post.id}")