0
0
Fork 0

Fix RSpec/DescribedClass cop (#25104)

This commit is contained in:
Matt Jankowski 2023-06-06 07:58:33 -04:00 committed by GitHub
parent 1e243e2df7
commit c42591356d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 347 additions and 414 deletions

View file

@ -10,12 +10,12 @@ RSpec.describe Favourite do
let(:status) { Fabricate(:status, reblog: reblog) }
it 'invalidates if the reblogged status is already a favourite' do
Favourite.create!(account: account, status: reblog)
expect(Favourite.new(account: account, status: status).valid?).to be false
described_class.create!(account: account, status: reblog)
expect(described_class.new(account: account, status: status).valid?).to be false
end
it 'replaces status with the reblogged one if it is a reblog' do
favourite = Favourite.create!(account: account, status: status)
favourite = described_class.create!(account: account, status: status)
expect(favourite.status).to eq reblog
end
end
@ -24,7 +24,7 @@ RSpec.describe Favourite do
let(:status) { Fabricate(:status, reblog: nil) }
it 'saves with the specified status' do
favourite = Favourite.create!(account: account, status: status)
favourite = described_class.create!(account: account, status: status)
expect(favourite.status).to eq status
end
end