Fix RSpec/ContextWording cop (#24739)

This commit is contained in:
Matt Jankowski
2023-05-03 23:49:08 -04:00
committed by GitHub
parent cf18cc2891
commit 710745e16b
105 changed files with 559 additions and 668 deletions

View File

@ -49,22 +49,22 @@ RSpec.describe Status, type: :model do
end
describe '#verb' do
context 'if destroyed?' do
context 'when destroyed?' do
it 'returns :delete' do
subject.destroy!
expect(subject.verb).to be :delete
end
end
context 'unless destroyed?' do
context 'if reblog?' do
context 'when not destroyed?' do
context 'when reblog?' do
it 'returns :share' do
subject.reblog = other
expect(subject.verb).to be :share
end
end
context 'unless reblog?' do
context 'when not reblog?' do
it 'returns :post' do
subject.reblog = nil
expect(subject.verb).to be :post
@ -85,28 +85,28 @@ RSpec.describe Status, type: :model do
end
describe '#hidden?' do
context 'if private_visibility?' do
context 'when private_visibility?' do
it 'returns true' do
subject.visibility = :private
expect(subject.hidden?).to be true
end
end
context 'if direct_visibility?' do
context 'when direct_visibility?' do
it 'returns true' do
subject.visibility = :direct
expect(subject.hidden?).to be true
end
end
context 'if public_visibility?' do
context 'when public_visibility?' do
it 'returns false' do
subject.visibility = :public
expect(subject.hidden?).to be false
end
end
context 'if unlisted_visibility?' do
context 'when unlisted_visibility?' do
it 'returns false' do
subject.visibility = :unlisted
expect(subject.hidden?).to be false