Fix RSpec/RepeatedExampleGroupDescription cop (#24850)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>shrike
parent
bf3ebeb42f
commit
2c2d924942
|
@ -643,11 +643,6 @@ RSpec/RepeatedExampleGroupBody:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'spec/controllers/statuses_controller_spec.rb'
|
- 'spec/controllers/statuses_controller_spec.rb'
|
||||||
|
|
||||||
RSpec/RepeatedExampleGroupDescription:
|
|
||||||
Exclude:
|
|
||||||
- 'spec/controllers/admin/reports/actions_controller_spec.rb'
|
|
||||||
- 'spec/policies/report_note_policy_spec.rb'
|
|
||||||
|
|
||||||
RSpec/StubbedMock:
|
RSpec/StubbedMock:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'spec/controllers/api/base_controller_spec.rb'
|
- 'spec/controllers/api/base_controller_spec.rb'
|
||||||
|
|
|
@ -146,13 +146,13 @@ describe Admin::Reports::ActionsController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with Action as submit button' do
|
context 'with action as submit button' do
|
||||||
subject { post :create, params: common_params.merge({ action => '' }) }
|
subject { post :create, params: common_params.merge({ action => '' }) }
|
||||||
|
|
||||||
it_behaves_like 'all action types'
|
it_behaves_like 'all action types'
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with Action as submit button' do
|
context 'with moderation action as an extra field' do
|
||||||
subject { post :create, params: common_params.merge({ moderation_action: action }) }
|
subject { post :create, params: common_params.merge({ moderation_action: action }) }
|
||||||
|
|
||||||
it_behaves_like 'all action types'
|
it_behaves_like 'all action types'
|
||||||
|
|
|
@ -30,19 +30,17 @@ RSpec.describe ReportNotePolicy do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when admin?' do
|
context 'when owner?' do
|
||||||
context 'when owner?' do
|
it 'permit' do
|
||||||
it 'permit' do
|
report_note = Fabricate(:report_note, account: john)
|
||||||
report_note = Fabricate(:report_note, account: john)
|
expect(subject).to permit(john, report_note)
|
||||||
expect(subject).to permit(john, report_note)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'with !owner?' do
|
context 'with !owner?' do
|
||||||
it 'denies' do
|
it 'denies' do
|
||||||
report_note = Fabricate(:report_note)
|
report_note = Fabricate(:report_note)
|
||||||
expect(subject).to_not permit(john, report_note)
|
expect(subject).to_not permit(john, report_note)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue