about summary refs log tree commit diff
path: root/spec/services/mute_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/mute_service_spec.rb')
-rw-r--r--spec/services/mute_service_spec.rb36
1 files changed, 34 insertions, 2 deletions
diff --git a/spec/services/mute_service_spec.rb b/spec/services/mute_service_spec.rb
index 8097cb250..2b3e3e152 100644
--- a/spec/services/mute_service_spec.rb
+++ b/spec/services/mute_service_spec.rb
@@ -18,8 +18,8 @@ RSpec.describe MuteService do
     end
 
     it "clears account's statuses" do
-      FeedManager.instance.push(:home, account, status)
-      FeedManager.instance.push(:home, account, other_account_status)
+      FeedManager.instance.push_to_home(account, status)
+      FeedManager.instance.push_to_home(account, other_account_status)
 
       is_expected.to change {
         Redis.current.zrange(home_timeline_key, 0, -1)
@@ -32,4 +32,36 @@ RSpec.describe MuteService do
       account.muting?(target_account)
     }.from(false).to(true)
   end
+
+  context 'without specifying a notifications parameter' do
+    it 'mutes notifications from the account' do
+      is_expected.to change {
+        account.muting_notifications?(target_account)
+      }.from(false).to(true)
+    end
+  end
+
+  context 'with a true notifications parameter' do
+    subject do
+      -> { described_class.new.call(account, target_account, notifications: true) }
+    end
+
+    it 'mutes notifications from the account' do
+      is_expected.to change {
+        account.muting_notifications?(target_account)
+      }.from(false).to(true)
+    end
+  end
+
+  context 'with a false notifications parameter' do
+    subject do
+      -> { described_class.new.call(account, target_account, notifications: false) }
+    end
+
+    it 'does not mute notifications from the account' do
+      is_expected.to_not change {
+        account.muting_notifications?(target_account)
+      }.from(false)
+    end
+  end
 end