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).
This commit is contained in:
aschmitz
2017-11-10 20:11:10 -06:00
parent 4944515020
commit b95c48748c
11 changed files with 170 additions and 14 deletions

View File

@ -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