Fix RSpec/ContextWording cop (#24739)
This commit is contained in:
parent
cf18cc2891
commit
710745e16b
105 changed files with 559 additions and 668 deletions
|
@ -20,7 +20,7 @@ RSpec.describe Admin::AccountAction, type: :model do
|
|||
)
|
||||
end
|
||||
|
||||
context 'type is "disable"' do
|
||||
context 'when type is "disable"' do
|
||||
let(:type) { 'disable' }
|
||||
|
||||
it 'disable user' do
|
||||
|
@ -29,7 +29,7 @@ RSpec.describe Admin::AccountAction, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
context 'type is "silence"' do
|
||||
context 'when type is "silence"' do
|
||||
let(:type) { 'silence' }
|
||||
|
||||
it 'silences account' do
|
||||
|
@ -38,7 +38,7 @@ RSpec.describe Admin::AccountAction, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
context 'type is "suspend"' do
|
||||
context 'when type is "suspend"' do
|
||||
let(:type) { 'suspend' }
|
||||
|
||||
it 'suspends account' do
|
||||
|
@ -75,7 +75,7 @@ RSpec.describe Admin::AccountAction, type: :model do
|
|||
describe '#report' do
|
||||
subject { account_action.report }
|
||||
|
||||
context 'report_id.present?' do
|
||||
context 'with report_id.present?' do
|
||||
before do
|
||||
account_action.report_id = Fabricate(:report).id
|
||||
end
|
||||
|
@ -85,7 +85,7 @@ RSpec.describe Admin::AccountAction, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
context '!report_id.present?' do
|
||||
context 'with !report_id.present?' do
|
||||
it 'returns nil' do
|
||||
expect(subject).to be_nil
|
||||
end
|
||||
|
@ -95,7 +95,7 @@ RSpec.describe Admin::AccountAction, type: :model do
|
|||
describe '#with_report?' do
|
||||
subject { account_action.with_report? }
|
||||
|
||||
context '!report.nil?' do
|
||||
context 'with !report.nil?' do
|
||||
before do
|
||||
account_action.report_id = Fabricate(:report).id
|
||||
end
|
||||
|
@ -105,7 +105,7 @@ RSpec.describe Admin::AccountAction, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
context '!(!report.nil?)' do
|
||||
context 'with !(!report.nil?)' do
|
||||
it 'returns false' do
|
||||
expect(subject).to be false
|
||||
end
|
||||
|
@ -115,7 +115,7 @@ RSpec.describe Admin::AccountAction, type: :model do
|
|||
describe '.types_for_account' do
|
||||
subject { described_class.types_for_account(account) }
|
||||
|
||||
context 'account.local?' do
|
||||
context 'when Account.local?' do
|
||||
let(:account) { Fabricate(:account, domain: nil) }
|
||||
|
||||
it 'returns ["none", "disable", "sensitive", "silence", "suspend"]' do
|
||||
|
@ -123,7 +123,7 @@ RSpec.describe Admin::AccountAction, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
context '!account.local?' do
|
||||
context 'with !account.local?' do
|
||||
let(:account) { Fabricate(:account, domain: 'hoge.com') }
|
||||
|
||||
it 'returns ["sensitive", "silence", "suspend"]' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue