3 class UserMuteTest < ActiveSupport::TestCase
4 def test_messages_by_muted_users_are_muted
6 muted_user = create(:user)
7 create(:user_mute, :owner => user, :subject => muted_user)
9 message = create(:message, :sender => muted_user, :recipient => user)
10 assert_predicate message, :muted?
13 def test_messages_by_admins_or_moderators_are_never_muted
16 [create(:administrator_user), create(:moderator_user)].each do |admin_or_moderator|
17 create(:user_mute, :owner => user, :subject => admin_or_moderator)
19 message = create(:message, :sender => admin_or_moderator, :recipient => user)
21 assert_not_predicate message, :muted?