Update rubocop-rspec to version 2.22.0, fix RSpec/IndexedLet
cop (#24698)
This commit is contained in:
parent
24015ef0cc
commit
4c5aa0e470
25 changed files with 334 additions and 322 deletions
|
@ -10,8 +10,8 @@ RSpec.describe BatchedRemoveStatusService, type: :service do
|
|||
let!(:jeff) { Fabricate(:account) }
|
||||
let!(:hank) { Fabricate(:account, username: 'hank', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox') }
|
||||
|
||||
let(:status1) { PostStatusService.new.call(alice, text: 'Hello @bob@example.com') }
|
||||
let(:status2) { PostStatusService.new.call(alice, text: 'Another status') }
|
||||
let(:status_alice_hello) { PostStatusService.new.call(alice, text: 'Hello @bob@example.com') }
|
||||
let(:status_alice_other) { PostStatusService.new.call(alice, text: 'Another status') }
|
||||
|
||||
before do
|
||||
allow(redis).to receive_messages(publish: nil)
|
||||
|
@ -22,23 +22,23 @@ RSpec.describe BatchedRemoveStatusService, type: :service do
|
|||
jeff.follow!(alice)
|
||||
hank.follow!(alice)
|
||||
|
||||
status1
|
||||
status2
|
||||
status_alice_hello
|
||||
status_alice_other
|
||||
|
||||
subject.call([status1, status2])
|
||||
subject.call([status_alice_hello, status_alice_other])
|
||||
end
|
||||
|
||||
it 'removes statuses' do
|
||||
expect { Status.find(status1.id) }.to raise_error ActiveRecord::RecordNotFound
|
||||
expect { Status.find(status2.id) }.to raise_error ActiveRecord::RecordNotFound
|
||||
expect { Status.find(status_alice_hello.id) }.to raise_error ActiveRecord::RecordNotFound
|
||||
expect { Status.find(status_alice_other.id) }.to raise_error ActiveRecord::RecordNotFound
|
||||
end
|
||||
|
||||
it 'removes statuses from author\'s home feed' do
|
||||
expect(HomeFeed.new(alice).get(10)).to_not include([status1.id, status2.id])
|
||||
expect(HomeFeed.new(alice).get(10)).to_not include([status_alice_hello.id, status_alice_other.id])
|
||||
end
|
||||
|
||||
it 'removes statuses from local follower\'s home feed' do
|
||||
expect(HomeFeed.new(jeff).get(10)).to_not include([status1.id, status2.id])
|
||||
expect(HomeFeed.new(jeff).get(10)).to_not include([status_alice_hello.id, status_alice_other.id])
|
||||
end
|
||||
|
||||
it 'notifies streaming API of followers' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue