summaryrefslogtreecommitdiffstats
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/user_test.rb')
-rw-r--r--test/unit/user_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index ede12e1ce..aeae62df8 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -1376,4 +1376,16 @@ class UserTest < ActiveSupport::TestCase
User.prune(7)
end
end
+
+ def test_destroy_should_delete_associated_reactions
+ users(:users_004).reactions.create!(
+ [
+ {reactable: issues(:issues_001)},
+ {reactable: issues(:issues_002)}
+ ]
+ )
+ assert_difference 'Reaction.count', -2 do
+ users(:users_004).destroy
+ end
+ end
end