about summary refs log tree commit diff
path: root/spec/services
diff options
context:
space:
mode:
authorSurinna Curtis <ekiru.0@gmail.com>2017-08-06 20:13:12 -0300
committerSurinna Curtis <ekiru.0@gmail.com>2017-09-13 21:47:30 -0500
commit500c4652269b13c0f3b7486e747946b863abb542 (patch)
tree1aba7608993208bee81cf59a567063c116f9c237 /spec/services
parent2ea9b164d315cedd98618b8b9626c2a2bec3ff36 (diff)
specs for MuteService notifications params
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/mute_service_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/services/mute_service_spec.rb b/spec/services/mute_service_spec.rb
index 8097cb250..800140b6f 100644
--- a/spec/services/mute_service_spec.rb
+++ b/spec/services/mute_service_spec.rb
@@ -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