|
|
@ -18,14 +18,11 @@ RSpec.describe UnfollowFollowWorker do
|
|
|
|
let(:show_reblogs) { true }
|
|
|
|
let(:show_reblogs) { true }
|
|
|
|
|
|
|
|
|
|
|
|
describe 'perform' do
|
|
|
|
describe 'perform' do
|
|
|
|
it 'unfollows source account and follows target account' do
|
|
|
|
it 'unfollows source account and follows target account and preserves show_reblogs' do
|
|
|
|
subject.perform(local_follower.id, source_account.id, target_account.id)
|
|
|
|
subject.perform(local_follower.id, source_account.id, target_account.id)
|
|
|
|
expect(local_follower.following?(source_account)).to be false
|
|
|
|
expect(local_follower.following?(source_account)).to be false
|
|
|
|
expect(local_follower.following?(target_account)).to be true
|
|
|
|
expect(local_follower.following?(target_account)).to be true
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it 'preserves show_reblogs' do
|
|
|
|
|
|
|
|
subject.perform(local_follower.id, source_account.id, target_account.id)
|
|
|
|
|
|
|
|
expect(Follow.find_by(account: local_follower, target_account: target_account).show_reblogs?).to be show_reblogs
|
|
|
|
expect(Follow.find_by(account: local_follower, target_account: target_account).show_reblogs?).to be show_reblogs
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -35,14 +32,11 @@ RSpec.describe UnfollowFollowWorker do
|
|
|
|
let(:show_reblogs) { false }
|
|
|
|
let(:show_reblogs) { false }
|
|
|
|
|
|
|
|
|
|
|
|
describe 'perform' do
|
|
|
|
describe 'perform' do
|
|
|
|
it 'unfollows source account and follows target account' do
|
|
|
|
it 'unfollows source account and follows target account and preserves show_reblogs' do
|
|
|
|
subject.perform(local_follower.id, source_account.id, target_account.id)
|
|
|
|
subject.perform(local_follower.id, source_account.id, target_account.id)
|
|
|
|
expect(local_follower.following?(source_account)).to be false
|
|
|
|
expect(local_follower.following?(source_account)).to be false
|
|
|
|
expect(local_follower.following?(target_account)).to be true
|
|
|
|
expect(local_follower.following?(target_account)).to be true
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it 'preserves show_reblogs' do
|
|
|
|
|
|
|
|
subject.perform(local_follower.id, source_account.id, target_account.id)
|
|
|
|
|
|
|
|
expect(Follow.find_by(account: local_follower, target_account: target_account).show_reblogs?).to be show_reblogs
|
|
|
|
expect(Follow.find_by(account: local_follower, target_account: target_account).show_reblogs?).to be show_reblogs
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|