about summary refs log tree commit diff
path: root/spec/models/follow_request_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/follow_request_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/follow_request_spec.rb')
-rw-r--r--spec/models/follow_request_spec.rb24
1 files changed, 23 insertions, 1 deletions
diff --git a/spec/models/follow_request_spec.rb b/spec/models/follow_request_spec.rb
index cc6f8ee62..62bd724d7 100644
--- a/spec/models/follow_request_spec.rb
+++ b/spec/models/follow_request_spec.rb
@@ -1,7 +1,29 @@
 require 'rails_helper'
 
 RSpec.describe FollowRequest, type: :model do
-  describe '#authorize!'
+  describe '#authorize!' do
+    it 'generates a Follow' do
+      follow_request = Fabricate.create(:follow_request)
+      follow_request.authorize!
+      target = follow_request.target_account
+      expect(follow_request.account.following?(target)).to be true
+    end
+
+    it 'correctly passes show_reblogs when true' do
+      follow_request = Fabricate.create(:follow_request, show_reblogs: true)
+      follow_request.authorize!
+      target = follow_request.target_account
+      expect(follow_request.account.muting_reblogs?(target)).to be false
+    end
+
+    it 'correctly passes show_reblogs when false' do
+      follow_request = Fabricate.create(:follow_request, show_reblogs: false)
+      follow_request.authorize!
+      target = follow_request.target_account
+      expect(follow_request.account.muting_reblogs?(target)).to be true
+    end
+  end
+
   describe '#reject!'
 
   describe 'validations' do