Enable RSpec/NotToNot cop and fix all issues

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
This commit is contained in:
Bertocq
2018-01-07 17:39:48 +01:00
parent 79a3b97c64
commit 34bb9d65b1
143 changed files with 1041 additions and 1038 deletions

View File

@@ -26,7 +26,7 @@ feature 'Legislation Draft Versions' do
within('select#draft_version_id') do
expect(page).to have_content("Version 1")
expect(page).to have_content("Version 2")
expect(page).to_not have_content("Version 3")
expect(page).not_to have_content("Version 3")
end
end
@@ -51,7 +51,7 @@ feature 'Legislation Draft Versions' do
select("Version 2")
click_button "see"
expect(page).to_not have_content("Body of the first version")
expect(page).not_to have_content("Body of the first version")
expect(page).to have_content("Body of the second version")
end
@@ -61,7 +61,7 @@ feature 'Legislation Draft Versions' do
select("Version 2")
expect(page).to_not have_content("Body of the first version")
expect(page).not_to have_content("Body of the first version")
expect(page).to have_content("Body of the second version")
end
@@ -73,8 +73,8 @@ feature 'Legislation Draft Versions' do
visit legislation_process_draft_version_path(@process, final_version)
expect(page).to have_content("Final body")
expect(page).to_not have_content("See all comments")
expect(page).to_not have_content("Comments")
expect(page).not_to have_content("See all comments")
expect(page).not_to have_content("Comments")
end
end
end
@@ -98,7 +98,7 @@ feature 'Legislation Draft Versions' do
within('select#draft_version_id') do
expect(page).to have_content("Version 1")
expect(page).to have_content("Version 2")
expect(page).to_not have_content("Version 3")
expect(page).not_to have_content("Version 3")
end
end
@@ -123,7 +123,7 @@ feature 'Legislation Draft Versions' do
select("Version 2")
click_button "see"
expect(page).to_not have_content("Changes for first version")
expect(page).not_to have_content("Changes for first version")
expect(page).to have_content("Changes for second version")
end
@@ -133,7 +133,7 @@ feature 'Legislation Draft Versions' do
select("Version 2")
expect(page).to_not have_content("Changes for first version")
expect(page).not_to have_content("Changes for first version")
expect(page).to have_content("Changes for second version")
end
end
@@ -151,7 +151,7 @@ feature 'Legislation Draft Versions' do
page.find(:css, ".legislation-annotatable").double_click
page.find(:css, ".annotator-adder button").click
expect(page).to_not have_css('#legislation_annotation_text')
expect(page).not_to have_css('#legislation_annotation_text')
expect(page).to have_content "You must Sign in or Sign up to leave a comment."
end
@@ -279,7 +279,7 @@ feature 'Legislation Draft Versions' do
select("Version 2")
click_button "see"
expect(page).to_not have_content("quote for version 1")
expect(page).not_to have_content("quote for version 1")
expect(page).to have_content("quote for version 2")
end
@@ -289,7 +289,7 @@ feature 'Legislation Draft Versions' do
select("Version 2")
expect(page).to_not have_content("quote for version 1")
expect(page).not_to have_content("quote for version 1")
expect(page).to have_content("quote for version 2")
end
end
@@ -307,8 +307,8 @@ feature 'Legislation Draft Versions' do
scenario "See one annotation with replies for a draft version" do
visit legislation_process_draft_version_annotation_path(@draft_version.process, @draft_version, @annotation)
expect(page).to_not have_content "ipsum"
expect(page).to_not have_content "my annotation"
expect(page).not_to have_content "ipsum"
expect(page).not_to have_content "my annotation"
expect(page).to have_content "audiam"
expect(page).to have_content "my other annotation"

View File

@@ -13,7 +13,7 @@ feature 'Legislation' do
visit send(path, not_published_process)
expect(page).to have_content not_permission_message
expect(page).to_not have_content("Process not published")
expect(page).not_to have_content("Process not published")
end
it "is available for an administrator user" do
@@ -54,17 +54,17 @@ feature 'Legislation' do
visit legislation_processes_path
expect(page).to have_content('Process open')
expect(page).to_not have_content('Process next')
expect(page).to_not have_content('Process past')
expect(page).not_to have_content('Process next')
expect(page).not_to have_content('Process past')
visit legislation_processes_path(filter: 'next')
expect(page).to_not have_content('Process open')
expect(page).not_to have_content('Process open')
expect(page).to have_content('Process next')
expect(page).to_not have_content('Process past')
expect(page).not_to have_content('Process past')
visit legislation_processes_path(filter: 'past')
expect(page).to_not have_content('Process open')
expect(page).to_not have_content('Process next')
expect(page).not_to have_content('Process open')
expect(page).not_to have_content('Process next')
expect(page).to have_content('Process past')
end
@@ -80,34 +80,34 @@ feature 'Legislation' do
it "aren't listed" do
visit legislation_processes_path
expect(page).to_not have_content('not published')
expect(page).not_to have_content('not published')
expect(page).to have_content('published')
login_as(administrator)
visit legislation_processes_path
expect(page).to_not have_content('not published')
expect(page).not_to have_content('not published')
expect(page).to have_content('published')
end
it "aren't listed with next filter" do
visit legislation_processes_path(filter: 'next')
expect(page).to_not have_content('not published')
expect(page).not_to have_content('not published')
expect(page).to have_content('next published')
login_as(administrator)
visit legislation_processes_path(filter: 'next')
expect(page).to_not have_content('not published')
expect(page).not_to have_content('not published')
expect(page).to have_content('next published')
end
it "aren't listed with past filter" do
visit legislation_processes_path(filter: 'past')
expect(page).to_not have_content('not published')
expect(page).not_to have_content('not published')
expect(page).to have_content('past published')
login_as(administrator)
visit legislation_processes_path(filter: 'past')
expect(page).to_not have_content('not published')
expect(page).not_to have_content('not published')
expect(page).to have_content('past published')
end
end

View File

@@ -31,7 +31,7 @@ feature 'Legislation' do
click_link "Next question"
expect(page).to have_content("Question 3")
expect(page).to_not have_content("Next question")
expect(page).not_to have_content("Next question")
end
scenario 'shows question page' do
@@ -55,7 +55,7 @@ feature 'Legislation' do
click_link "Next question"
expect(page).to have_content("Question 3")
expect(page).to_not have_content("Next question")
expect(page).not_to have_content("Next question")
end
scenario 'answer question' do
@@ -79,10 +79,10 @@ feature 'Legislation' do
within(:css, "label.active") do
expect(page).to have_content("I don't know")
expect(page).to_not have_content("Yes")
expect(page).to_not have_content("No")
expect(page).not_to have_content("Yes")
expect(page).not_to have_content("No")
end
expect(page).to_not have_selector(:link_or_button, "Submit answer")
expect(page).not_to have_selector(:link_or_button, "Submit answer")
expect(question.reload.answers_count).to eq(1)
expect(option.reload.answers_count).to eq(1)
@@ -104,7 +104,7 @@ feature 'Legislation' do
expect(page).to have_selector(:radio_button, "No", disabled: true)
expect(page).to have_selector(:radio_button, "I don't know", disabled: true)
expect(page).to_not have_selector(:link_or_button, "Submit answer")
expect(page).not_to have_selector(:link_or_button, "Submit answer")
end
end
end