Enables RSpec/ExampleWording and fixes all issues

Both avoiding 'should' and repiting 'it' on the tests description
improves reading them and also makes all descriptions consistent.

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording
This commit is contained in:
Bertocq
2018-01-07 00:57:50 +01:00
parent 971f2e308a
commit ed16a78f42
73 changed files with 482 additions and 479 deletions

View File

@@ -10,7 +10,7 @@ describe Legislation::AnnotationsController do
@user = create(:user, :level_two)
end
it 'should create an ahoy event' do
it 'creates an ahoy event' do
sign_in @user
post :create, process_id: @process.id,
@@ -24,7 +24,7 @@ describe Legislation::AnnotationsController do
expect(Ahoy::Event.last.properties['legislation_annotation_id']).to eq Legislation::Annotation.last.id
end
it 'should not create an annotation if the draft version is a final version' do
it 'does not create an annotation if the draft version is a final version' do
sign_in @user
post :create, process_id: @process.id,
@@ -38,7 +38,7 @@ describe Legislation::AnnotationsController do
expect(response).to have_http_status(:not_found)
end
it 'should create an annotation if the process allegations phase is open' do
it 'creates an annotation if the process allegations phase is open' do
sign_in @user
expect do
@@ -52,7 +52,7 @@ describe Legislation::AnnotationsController do
end.to change { @draft_version.annotations.count }.by(1)
end
it 'should not create an annotation if the process allegations phase is not open' do
it 'does not create an annotation if the process allegations phase is not open' do
sign_in @user
@process.update_attribute(:allegations_end_date, Date.current - 1.day)
@@ -67,7 +67,7 @@ describe Legislation::AnnotationsController do
end.to_not change { @draft_version.annotations.count }
end
it 'should create an annotation by parsing parameters in JSON' do
it 'creates an annotation by parsing parameters in JSON' do
sign_in @user
expect do
@@ -81,7 +81,7 @@ describe Legislation::AnnotationsController do
end.to change { @draft_version.annotations.count }.by(1)
end
it 'should create a new comment on an existing annotation when range is the same' do
it 'creates a new comment on an existing annotation when range is the same' do
annotation = create(:legislation_annotation, draft_version: @draft_version, text: "my annotation",
ranges: [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}],
range_start: "/p[1]", range_start_offset: 6, range_end: "/p[1]", range_end_offset: 11)