about summary refs log tree commit diff
path: root/spec/models/concerns/account_interactions_spec.rb
diff options
context:
space:
mode:
authoraschmitz <aschmitz@lardbucket.org>2017-11-10 20:11:10 -0600
committeraschmitz <aschmitz@lardbucket.org>2017-11-10 22:04:54 -0600
commitb95c48748cd4e7a1181cdf3f17e23d6e526a9d95 (patch)
treea3d69c3831ef59755609a999c8eaae23c720049f /spec/models/concerns/account_interactions_spec.rb
parent49445150202f0bdaae942b9ae1ba44802a1c22e9 (diff)
Per-user reblog hiding implementation/fixes/tests
Note that this will only hide/show *future* reblogs by a user, and does
nothing to remove/add reblogs that are already in the timeline. I don't
think that's a particularly confusing behavior, and it's a lot easier
to implement (similar to mutes, I believe).
Diffstat (limited to 'spec/models/concerns/account_interactions_spec.rb')
-rw-r--r--spec/models/concerns/account_interactions_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/models/concerns/account_interactions_spec.rb b/spec/models/concerns/account_interactions_spec.rb
index ef957fc1d..f47d9d057 100644
--- a/spec/models/concerns/account_interactions_spec.rb
+++ b/spec/models/concerns/account_interactions_spec.rb
@@ -37,4 +37,41 @@ describe AccountInteractions do
       end
     end
   end
+
+  describe 'ignoring reblogs from an account' do
+    before do
+      @me = Fabricate(:account, username: 'Me')
+      @you = Fabricate(:account, username: 'You')
+    end
+
+    context 'with the reblogs option unspecified' do
+      before do
+        @me.follow!(@you)
+      end
+
+      it 'defaults to showing reblogs' do
+        expect(@me.muting_reblogs?(@you)).to be(false)
+      end
+    end
+
+    context 'with the reblogs option set to false' do
+      before do
+        @me.follow!(@you, reblogs: false)
+      end
+
+      it 'does mute reblogs' do
+        expect(@me.muting_reblogs?(@you)).to be(true)
+      end
+    end
+
+    context 'with the reblogs option set to true' do
+      before do
+        @me.follow!(@you, reblogs: true)
+      end
+
+      it 'does not mute reblogs' do
+        expect(@me.muting_reblogs?(@you)).to be(false)
+      end
+    end
+  end
 end