Fix RSpec/DescribedClass cop (#25104)
This commit is contained in:
@@ -8,14 +8,14 @@ RSpec.describe StatusPin do
|
||||
account = Fabricate(:account)
|
||||
status = Fabricate(:status, account: account)
|
||||
|
||||
expect(StatusPin.new(account: account, status: status).save).to be true
|
||||
expect(described_class.new(account: account, status: status).save).to be true
|
||||
end
|
||||
|
||||
it 'does not allow pins of statuses by someone else' do
|
||||
account = Fabricate(:account)
|
||||
status = Fabricate(:status)
|
||||
|
||||
expect(StatusPin.new(account: account, status: status).save).to be false
|
||||
expect(described_class.new(account: account, status: status).save).to be false
|
||||
end
|
||||
|
||||
it 'does not allow pins of reblogs' do
|
||||
@@ -23,21 +23,21 @@ RSpec.describe StatusPin do
|
||||
status = Fabricate(:status, account: account)
|
||||
reblog = Fabricate(:status, reblog: status)
|
||||
|
||||
expect(StatusPin.new(account: account, status: reblog).save).to be false
|
||||
expect(described_class.new(account: account, status: reblog).save).to be false
|
||||
end
|
||||
|
||||
it 'does allow pins of direct statuses' do
|
||||
account = Fabricate(:account)
|
||||
status = Fabricate(:status, account: account, visibility: :private)
|
||||
|
||||
expect(StatusPin.new(account: account, status: status).save).to be true
|
||||
expect(described_class.new(account: account, status: status).save).to be true
|
||||
end
|
||||
|
||||
it 'does not allow pins of direct statuses' do
|
||||
account = Fabricate(:account)
|
||||
status = Fabricate(:status, account: account, visibility: :direct)
|
||||
|
||||
expect(StatusPin.new(account: account, status: status).save).to be false
|
||||
expect(described_class.new(account: account, status: status).save).to be false
|
||||
end
|
||||
|
||||
max_pins = 5
|
||||
@@ -50,10 +50,10 @@ RSpec.describe StatusPin do
|
||||
end
|
||||
|
||||
max_pins.times do |i|
|
||||
expect(StatusPin.new(account: account, status: status[i]).save).to be true
|
||||
expect(described_class.new(account: account, status: status[i]).save).to be true
|
||||
end
|
||||
|
||||
expect(StatusPin.new(account: account, status: status[max_pins]).save).to be false
|
||||
expect(described_class.new(account: account, status: status[max_pins]).save).to be false
|
||||
end
|
||||
|
||||
it 'allows pins above the max for remote accounts' do
|
||||
@@ -65,10 +65,10 @@ RSpec.describe StatusPin do
|
||||
end
|
||||
|
||||
max_pins.times do |i|
|
||||
expect(StatusPin.new(account: account, status: status[i]).save).to be true
|
||||
expect(described_class.new(account: account, status: status[i]).save).to be true
|
||||
end
|
||||
|
||||
expect(StatusPin.new(account: account, status: status[max_pins]).save).to be true
|
||||
expect(described_class.new(account: account, status: status[max_pins]).save).to be true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user