about summary refs log tree commit diff
path: root/spec/services/notify_service_spec.rb
diff options
context:
space:
mode:
authorbeatrix <beatrix.bitrot@gmail.com>2017-11-15 12:01:17 -0500
committerGitHub <noreply@github.com>2017-11-15 12:01:17 -0500
commit04508868b07f5631eddda3e4d8240dde9b751fd4 (patch)
treedfef112d85f778bcebb24f4c3d76c28c0e422a9e /spec/services/notify_service_spec.rb
parentbfd9230d61effe537874f02de87b6415bae45ae1 (diff)
parent9a42f7cbed28ca010eca6cef89298ab806ce298f (diff)
Merge pull request #212 from aschmitz/feat/mute-reblogs
Allow hiding reblogs on a per-follow basis
Diffstat (limited to 'spec/services/notify_service_spec.rb')
-rw-r--r--spec/services/notify_service_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/services/notify_service_spec.rb b/spec/services/notify_service_spec.rb
index 7088ae9d1..250a880a2 100644
--- a/spec/services/notify_service_spec.rb
+++ b/spec/services/notify_service_spec.rb
@@ -48,6 +48,26 @@ RSpec.describe NotifyService do
     is_expected.to_not change(Notification, :count)
   end
 
+  describe 'reblogs' do
+    let(:status)   { Fabricate(:status, account: Fabricate(:account)) }
+    let(:activity) { Fabricate(:status, account: sender, reblog: status) }
+
+    it 'shows reblogs by default' do
+      recipient.follow!(sender)
+      is_expected.to change(Notification, :count)
+    end
+
+    it 'shows reblogs when explicitly enabled' do
+      recipient.follow!(sender, reblogs: true)
+      is_expected.to change(Notification, :count)
+    end
+
+    it 'hides reblogs when disabled' do
+      recipient.follow!(sender, reblogs: false)
+      is_expected.to_not change(Notification, :count)
+    end
+  end
+
   context do
     let(:asshole)  { Fabricate(:account, username: 'asshole') }
     let(:reply_to) { Fabricate(:status, account: asshole) }