0
0
Fork 0

Update rubocop-rspec to version 2.22.0, fix RSpec/IndexedLet cop (#24698)

This commit is contained in:
Matt Jankowski 2023-06-14 10:44:37 -04:00 committed by GitHub
parent 24015ef0cc
commit 4c5aa0e470
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 334 additions and 322 deletions

View file

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