about summary refs log tree commit diff
path: root/spec/models/concerns
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2017-11-28 11:45:13 -0600
committerDavid Yip <yipdw@member.fsf.org>2017-11-28 11:45:13 -0600
commit95c270f5b1ffd328345a7b1223f65876f3d88423 (patch)
tree621e27e89b238d8806fdd3294009361d0691f49c /spec/models/concerns
parent7463d80ff442833a4ad299460f37c27be9b8cda1 (diff)
parent15fab79cfa5b732e9d7816f162272d72cf06c733 (diff)
Merge remote-tracking branch 'origin/master' into gs-master
Diffstat (limited to 'spec/models/concerns')
-rw-r--r--spec/models/concerns/account_interactions_spec.rb39
1 files changed, 38 insertions, 1 deletions
diff --git a/spec/models/concerns/account_interactions_spec.rb b/spec/models/concerns/account_interactions_spec.rb
index 0b3a1a63e..95bf9561d 100644
--- a/spec/models/concerns/account_interactions_spec.rb
+++ b/spec/models/concerns/account_interactions_spec.rb
@@ -13,7 +13,7 @@ describe AccountInteractions do
 
     context 'account with Follow' do
       it 'returns { target_account_id => { reblogs: true } }' do
-        Fabricate(:follow, account: account, target_account: target_account, show_reblogs: true)
+        Fabricate(:follow, account: account, target_account: target_account)
         is_expected.to eq(target_account_id => { reblogs: true })
       end
     end
@@ -627,4 +627,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