diff --git a/.rubocop.yml b/.rubocop.yml index d41f61ee6..a2a787cc2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -146,4 +146,7 @@ RSpec/NamedSubject: RSpec/NestedGroups: Enabled: true - Max: 4 \ No newline at end of file + Max: 4 + +RSpec/NotToNot: + Enabled: true \ No newline at end of file diff --git a/spec/controllers/admin/api/stats_controller_spec.rb b/spec/controllers/admin/api/stats_controller_spec.rb index 99e1be4f9..97ad5d0be 100644 --- a/spec/controllers/admin/api/stats_controller_spec.rb +++ b/spec/controllers/admin/api/stats_controller_spec.rb @@ -10,7 +10,7 @@ describe Admin::Api::StatsController do sign_in user get :show - expect(response).to_not be_ok + expect(response).not_to be_ok expect(response.status).to eq 400 end end diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb index 946ef68dc..047e76e85 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/comments_controller_spec.rb @@ -24,7 +24,7 @@ describe CommentsController do expect do xhr :post, :create, comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"} - end.to_not change { @question.reload.comments_count } + end.not_to change { @question.reload.comments_count } end it 'does not create a comment for unverified users when the commentable requires it' do @@ -32,7 +32,7 @@ describe CommentsController do expect do xhr :post, :create, comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"} - end.to_not change { @question.reload.comments_count } + end.not_to change { @question.reload.comments_count } end end end diff --git a/spec/controllers/debates_controller_spec.rb b/spec/controllers/debates_controller_spec.rb index a48f09396..64d1fa597 100644 --- a/spec/controllers/debates_controller_spec.rb +++ b/spec/controllers/debates_controller_spec.rb @@ -43,7 +43,7 @@ describe DebatesController do expect do xhr :post, :vote, id: debate.id, value: 'yes' - end.to_not change { debate.reload.votes_for.size } + end.not_to change { debate.reload.votes_for.size } end end end diff --git a/spec/controllers/legislation/annotations_controller_spec.rb b/spec/controllers/legislation/annotations_controller_spec.rb index c95833076..80335a209 100644 --- a/spec/controllers/legislation/annotations_controller_spec.rb +++ b/spec/controllers/legislation/annotations_controller_spec.rb @@ -64,7 +64,7 @@ describe Legislation::AnnotationsController do "ranges" => [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}], "text": "una anotacion" } - end.to_not change { @draft_version.annotations.count } + end.not_to change { @draft_version.annotations.count } end it 'creates an annotation by parsing parameters in JSON' do @@ -95,7 +95,7 @@ describe Legislation::AnnotationsController do "ranges" => [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}], "text": "una anotacion" } - end.to_not change { @draft_version.annotations.count } + end.not_to change { @draft_version.annotations.count } expect(annotation.reload.comments_count).to eq(2) expect(annotation.comments.last.body).to eq("una anotacion") diff --git a/spec/controllers/legislation/answers_controller_spec.rb b/spec/controllers/legislation/answers_controller_spec.rb index aab57fbbe..466a90eb8 100644 --- a/spec/controllers/legislation/answers_controller_spec.rb +++ b/spec/controllers/legislation/answers_controller_spec.rb @@ -35,7 +35,7 @@ describe Legislation::AnswersController do expect do xhr :post, :create, process_id: @process.id, question_id: @question.id, legislation_answer: { legislation_question_option_id: @question_option.id } - end.to_not change { @question.reload.answers_count } + end.not_to change { @question.reload.answers_count } end end end diff --git a/spec/features/account_spec.rb b/spec/features/account_spec.rb index 67dfd6e5f..469ec6b70 100644 --- a/spec/features/account_spec.rb +++ b/spec/features/account_spec.rb @@ -24,7 +24,7 @@ feature 'Account' do visit account_path expect(page).to have_selector("input[value='Manuela Corp']") - expect(page).to_not have_selector("input[value='Manuela Colau']") + expect(page).not_to have_selector("input[value='Manuela Colau']") expect(page).to have_selector(avatar('Manuela Corp'), count: 1) end @@ -46,8 +46,8 @@ feature 'Account' do expect(page).to have_selector("input[value='Larry Bird']") expect(find("#account_email_on_comment")).to be_checked expect(find("#account_email_on_comment_reply")).to be_checked - expect(find("#account_email_digest")).to_not be_checked - expect(find("#account_email_on_direct_message")).to_not be_checked + expect(find("#account_email_digest")).not_to be_checked + expect(find("#account_email_on_direct_message")).not_to be_checked end scenario 'Edit Organization' do @@ -92,12 +92,12 @@ feature 'Account' do login_as(official_user2) visit account_path - expect(page).to_not have_css '#account_official_position_badge' + expect(page).not_to have_css '#account_official_position_badge' login_as(official_user3) visit account_path - expect(page).to_not have_css '#account_official_position_badge' + expect(page).not_to have_css '#account_official_position_badge' end end diff --git a/spec/features/admin/activity_spec.rb b/spec/features/admin/activity_spec.rb index 9a1f8aaf8..3020d2520 100644 --- a/spec/features/admin/activity_spec.rb +++ b/spec/features/admin/activity_spec.rb @@ -46,7 +46,7 @@ feature 'Admin activity' do visit admin_activity_path expect(page).to have_content(proposal1.title) - expect(page).to_not have_content(proposal2.title) + expect(page).not_to have_content(proposal2.title) expect(page).to have_content(proposal3.title) end @@ -108,7 +108,7 @@ feature 'Admin activity' do visit admin_activity_path expect(page).to have_content(debate1.title) - expect(page).to_not have_content(debate2.title) + expect(page).not_to have_content(debate2.title) expect(page).to have_content(debate3.title) end @@ -171,7 +171,7 @@ feature 'Admin activity' do visit admin_activity_path expect(page).to have_content(comment1.body) - expect(page).to_not have_content(comment2.body) + expect(page).not_to have_content(comment2.body) expect(page).to have_content(comment3.body) end @@ -256,7 +256,7 @@ feature 'Admin activity' do expect(page).to have_content(proposal1.author.email) expect(page).to have_content(proposal3.author.username) expect(page).to have_content(proposal3.author.email) - expect(page).to_not have_content(proposal2.author.username) + expect(page).not_to have_content(proposal2.author.username) end scenario "Shows moderation activity from debates moderation screen" do @@ -282,7 +282,7 @@ feature 'Admin activity' do expect(page).to have_content(debate1.author.email) expect(page).to have_content(debate3.author.username) expect(page).to have_content(debate3.author.email) - expect(page).to_not have_content(debate2.author.username) + expect(page).not_to have_content(debate2.author.username) end scenario "Shows moderation activity from comments moderation screen" do @@ -308,7 +308,7 @@ feature 'Admin activity' do expect(page).to have_content(comment1.author.email) expect(page).to have_content(comment3.author.username) expect(page).to have_content(comment3.author.email) - expect(page).to_not have_content(comment2.author.username) + expect(page).not_to have_content(comment2.author.username) end scenario "Shows admin restores" do diff --git a/spec/features/admin/administrators_spec.rb b/spec/features/admin/administrators_spec.rb index c39d5ade5..d775aaa74 100644 --- a/spec/features/admin/administrators_spec.rb +++ b/spec/features/admin/administrators_spec.rb @@ -12,7 +12,7 @@ feature 'Admin administrators' do scenario 'Index' do expect(page).to have_content @administrator.name expect(page).to have_content @administrator.email - expect(page).to_not have_content @user.name + expect(page).not_to have_content @user.name end scenario 'Create Administrator', :js do @@ -30,7 +30,7 @@ feature 'Admin administrators' do find(:xpath, "//tr[contains(.,'#{@administrator.name}')]/td/a", text: 'Delete').click within("#administrators") do - expect(page).to_not have_content @administrator.name + expect(page).not_to have_content @administrator.name end end @@ -61,8 +61,8 @@ feature 'Admin administrators' do expect(page).to have_content('Administrators: User search') expect(page).to have_content('No results found') - expect(page).to_not have_content(@administrator1.name) - expect(page).to_not have_content(@administrator2.name) + expect(page).not_to have_content(@administrator1.name) + expect(page).not_to have_content(@administrator2.name) end scenario 'search by name' do @@ -74,7 +74,7 @@ feature 'Admin administrators' do expect(page).to have_content('Administrators: User search') expect(page).to have_content(@administrator1.name) - expect(page).to_not have_content(@administrator2.name) + expect(page).not_to have_content(@administrator2.name) end scenario 'search by email' do @@ -86,7 +86,7 @@ feature 'Admin administrators' do expect(page).to have_content('Administrators: User search') expect(page).to have_content(@administrator2.email) - expect(page).to_not have_content(@administrator1.email) + expect(page).not_to have_content(@administrator1.email) end end diff --git a/spec/features/admin/banners_spec.rb b/spec/features/admin/banners_spec.rb index 28a105bed..70e1469d3 100644 --- a/spec/features/admin/banners_spec.rb +++ b/spec/features/admin/banners_spec.rb @@ -136,8 +136,8 @@ feature 'Admin banners magement' do expect(page).to have_content 'Modified title' expect(page).to have_content 'Edited text' - expect(page).to_not have_content 'Hello' - expect(page).to_not have_content 'Wrong text' + expect(page).not_to have_content 'Hello' + expect(page).not_to have_content 'Wrong text' end scenario 'Delete a banner' do @@ -160,7 +160,7 @@ feature 'Admin banners magement' do click_link "Delete banner" visit admin_root_path - expect(page).to_not have_content 'Ugly banner' + expect(page).not_to have_content 'Ugly banner' end end diff --git a/spec/features/admin/budget_investment_milestones_spec.rb b/spec/features/admin/budget_investment_milestones_spec.rb index f3de2157e..4221d5647 100644 --- a/spec/features/admin/budget_investment_milestones_spec.rb +++ b/spec/features/admin/budget_investment_milestones_spec.rb @@ -98,7 +98,7 @@ feature 'Admin budget investment milestones' do click_link "Delete milestone" - expect(page).to_not have_content 'Title will it remove' + expect(page).not_to have_content 'Title will it remove' end end diff --git a/spec/features/admin/budget_investments_spec.rb b/spec/features/admin/budget_investments_spec.rb index 1ad89e6aa..6556cec7c 100644 --- a/spec/features/admin/budget_investments_spec.rb +++ b/spec/features/admin/budget_investments_spec.rb @@ -88,8 +88,8 @@ feature 'Admin budget investments' do select "Parks: Central Park", from: "heading_id" - expect(page).to_not have_link("Realocate visitors") - expect(page).to_not have_link("Change name") + expect(page).not_to have_link("Realocate visitors") + expect(page).not_to have_link("Change name") expect(page).to have_link("Plant trees") select "All headings", from: "heading_id" @@ -101,14 +101,14 @@ feature 'Admin budget investments' do select "Streets: Main Avenue", from: "heading_id" expect(page).to have_link("Realocate visitors") - expect(page).to_not have_link("Change name") - expect(page).to_not have_link("Plant trees") + expect(page).not_to have_link("Change name") + expect(page).not_to have_link("Plant trees") select "Streets: Mercy Street", from: "heading_id" - expect(page).to_not have_link("Realocate visitors") + expect(page).not_to have_link("Realocate visitors") expect(page).to have_link("Change name") - expect(page).to_not have_link("Plant trees") + expect(page).not_to have_link("Plant trees") end scenario "Filtering by admin", :js do @@ -125,7 +125,7 @@ feature 'Admin budget investments' do select "Admin 1", from: "administrator_id" expect(page).to have_content('There is 1 investment') - expect(page).to_not have_link("Destroy the city") + expect(page).not_to have_link("Destroy the city") expect(page).to have_link("Realocate visitors") select "All administrators", from: "administrator_id" @@ -136,7 +136,7 @@ feature 'Admin budget investments' do select "Admin 1", from: "administrator_id" expect(page).to have_content('There is 1 investment') - expect(page).to_not have_link("Destroy the city") + expect(page).not_to have_link("Destroy the city") expect(page).to have_link("Realocate visitors") end @@ -156,7 +156,7 @@ feature 'Admin budget investments' do select "Valuator 1", from: "valuator_id" expect(page).to have_content('There is 1 investment') - expect(page).to_not have_link("Destroy the city") + expect(page).not_to have_link("Destroy the city") expect(page).to have_link("Realocate visitors") select "All valuators", from: "valuator_id" @@ -167,7 +167,7 @@ feature 'Admin budget investments' do select "Valuator 1", from: "valuator_id" expect(page).to have_content('There is 1 investment') - expect(page).to_not have_link("Destroy the city") + expect(page).not_to have_link("Destroy the city") expect(page).to have_link("Realocate visitors") end @@ -181,13 +181,13 @@ feature 'Admin budget investments' do visit admin_budget_budget_investments_path(budget_id: @budget.id) - expect(page).to_not have_link(filters_links.values.first) + expect(page).not_to have_link(filters_links.values.first) filters_links.keys.drop(1).each { |filter| expect(page).to have_link(filters_links[filter]) } filters_links.each_pair do |current_filter, link| visit admin_budget_budget_investments_path(budget_id: @budget.id, filter: current_filter) - expect(page).to_not have_link(link) + expect(page).not_to have_link(link) (filters_links.keys - [current_filter]).each do |filter| expect(page).to have_link(filters_links[filter]) @@ -208,12 +208,12 @@ feature 'Admin budget investments' do visit admin_budget_budget_investments_path(budget_id: @budget.id, filter: 'without_admin') expect(page).to have_content("Evaluating...") - expect(page).to_not have_content("Assigned idea") + expect(page).not_to have_content("Assigned idea") visit admin_budget_budget_investments_path(budget_id: @budget.id, filter: 'managed') expect(page).to have_content("Assigned idea") - expect(page).to_not have_content("Evaluating...") + expect(page).not_to have_content("Evaluating...") end scenario "Filtering by valuation status" do @@ -225,16 +225,16 @@ feature 'Admin budget investments' do visit admin_budget_budget_investments_path(budget_id: @budget.id, filter: 'valuation_open') expect(page).to have_content("Ongoing valuation") - expect(page).to_not have_content("Old idea") + expect(page).not_to have_content("Old idea") visit admin_budget_budget_investments_path(budget_id: @budget.id, filter: 'valuating') expect(page).to have_content("Ongoing valuation") - expect(page).to_not have_content("Old idea") + expect(page).not_to have_content("Old idea") visit admin_budget_budget_investments_path(budget_id: @budget.id, filter: 'valuation_finished') - expect(page).to_not have_content("Ongoing valuation") + expect(page).not_to have_content("Ongoing valuation") expect(page).to have_content("Old idea") visit admin_budget_budget_investments_path(budget_id: @budget.id, filter: 'all') @@ -256,7 +256,7 @@ feature 'Admin budget investments' do visit admin_budget_budget_investments_path(budget_id: @budget.id, tag_name: 'Education') - expect(page).to_not have_content("More hospitals") + expect(page).not_to have_content("More hospitals") expect(page).to have_css(".budget_investment", count: 2) expect(page).to have_content("Educate the children") expect(page).to have_content("More schools") @@ -378,8 +378,8 @@ feature 'Admin budget investments' do within('#assigned_valuators') do expect(page).to have_content('Valentina (v1@valuators.org)') expect(page).to have_content('Val (v3@valuators.org)') - expect(page).to_not have_content('Undefined') - expect(page).to_not have_content('Valerian (v2@valuators.org)') + expect(page).not_to have_content('Undefined') + expect(page).not_to have_content('Valerian (v2@valuators.org)') end end @@ -400,7 +400,7 @@ feature 'Admin budget investments' do within "#tags" do expect(page).to have_content 'Education' - expect(page).to_not have_content 'Health' + expect(page).not_to have_content 'Health' end end @@ -429,7 +429,7 @@ feature 'Admin budget investments' do visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment) within("#user-tags") do - expect(page).to_not have_content "Education" + expect(page).not_to have_content "Education" expect(page).to have_content "Park" end @@ -442,15 +442,15 @@ feature 'Admin budget investments' do visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment) within("#user-tags") do - expect(page).to_not have_content "Education" - expect(page).to_not have_content "Environment" + expect(page).not_to have_content "Education" + expect(page).not_to have_content "Environment" expect(page).to have_content "Park, Trees" end within("#tags") do expect(page).to have_content "Education, Environment" - expect(page).to_not have_content "Park" - expect(page).to_not have_content "Trees" + expect(page).not_to have_content "Park" + expect(page).not_to have_content "Trees" end end @@ -468,7 +468,7 @@ feature 'Admin budget investments' do visit budget_investment_path(budget_investment.budget, budget_investment) expect(page).to have_content "Park" - expect(page).to_not have_content "Refugees, Solidarity" + expect(page).not_to have_content "Refugees, Solidarity" end scenario "Errors on update" do @@ -498,31 +498,31 @@ feature 'Admin budget investments' do visit admin_budget_budget_investments_path(@budget) within('#filter-subnav') { click_link 'Valuation finished' } - expect(page).to_not have_content(unfeasible_bi.title) - expect(page).to_not have_content(feasible_bi.title) + expect(page).not_to have_content(unfeasible_bi.title) + expect(page).not_to have_content(feasible_bi.title) expect(page).to have_content(feasible_vf_bi.title) expect(page).to have_content(selected_bi.title) expect(page).to have_content(winner_bi.title) within('#filter-subnav') { click_link 'Val. fin. Feasible' } - expect(page).to_not have_content(unfeasible_bi.title) - expect(page).to_not have_content(feasible_bi.title) + expect(page).not_to have_content(unfeasible_bi.title) + expect(page).not_to have_content(feasible_bi.title) expect(page).to have_content(feasible_vf_bi.title) expect(page).to have_content(selected_bi.title) expect(page).to have_content(winner_bi.title) within('#filter-subnav') { click_link 'Selected' } - expect(page).to_not have_content(unfeasible_bi.title) - expect(page).to_not have_content(feasible_bi.title) - expect(page).to_not have_content(feasible_vf_bi.title) + expect(page).not_to have_content(unfeasible_bi.title) + expect(page).not_to have_content(feasible_bi.title) + expect(page).not_to have_content(feasible_vf_bi.title) expect(page).to have_content(selected_bi.title) expect(page).to have_content(winner_bi.title) within('#filter-subnav') { click_link 'Winners' } - expect(page).to_not have_content(unfeasible_bi.title) - expect(page).to_not have_content(feasible_bi.title) - expect(page).to_not have_content(feasible_vf_bi.title) - expect(page).to_not have_content(selected_bi.title) + expect(page).not_to have_content(unfeasible_bi.title) + expect(page).not_to have_content(feasible_bi.title) + expect(page).not_to have_content(feasible_vf_bi.title) + expect(page).not_to have_content(selected_bi.title) expect(page).to have_content(winner_bi.title) end @@ -531,22 +531,22 @@ feature 'Admin budget investments' do within('#filter-subnav') { click_link 'All' } within("#budget_investment_#{unfeasible_bi.id}") do - expect(page).to_not have_link('Select') - expect(page).to_not have_link('Selected') + expect(page).not_to have_link('Select') + expect(page).not_to have_link('Selected') end within("#budget_investment_#{feasible_bi.id}") do - expect(page).to_not have_link('Select') - expect(page).to_not have_link('Selected') + expect(page).not_to have_link('Select') + expect(page).not_to have_link('Selected') end within("#budget_investment_#{feasible_vf_bi.id}") do expect(page).to have_link('Select') - expect(page).to_not have_link('Selected') + expect(page).not_to have_link('Selected') end within("#budget_investment_#{selected_bi.id}") do - expect(page).to_not have_link('Select') + expect(page).not_to have_link('Select') expect(page).to have_link('Selected') end end @@ -563,7 +563,7 @@ feature 'Admin budget investments' do within('#filter-subnav') { click_link 'Selected' } within("#budget_investment_#{feasible_vf_bi.id}") do - expect(page).to_not have_link('Select') + expect(page).not_to have_link('Select') expect(page).to have_link('Selected') end end @@ -578,14 +578,14 @@ feature 'Admin budget investments' do click_link('Selected') end - expect(page).to_not have_content(selected_bi.title) + expect(page).not_to have_content(selected_bi.title) expect(page).to have_content('There is 1 investment') within('#filter-subnav') { click_link 'All' } within("#budget_investment_#{selected_bi.id}") do expect(page).to have_link('Select') - expect(page).to_not have_link('Selected') + expect(page).not_to have_link('Selected') end end diff --git a/spec/features/admin/budgets_spec.rb b/spec/features/admin/budgets_spec.rb index d4ed2d2ac..7be11abba 100644 --- a/spec/features/admin/budgets_spec.rb +++ b/spec/features/admin/budgets_spec.rb @@ -45,13 +45,13 @@ feature 'Admin budgets' do expect(page).to have_content(budget2.name) expect(page).to have_content(budget3.name) expect(page).to have_content(budget4.name) - expect(page).to_not have_content(budget5.name) + expect(page).not_to have_content(budget5.name) click_link 'Finished' - expect(page).to_not have_content(budget1.name) - expect(page).to_not have_content(budget2.name) - expect(page).to_not have_content(budget3.name) - expect(page).to_not have_content(budget4.name) + expect(page).not_to have_content(budget1.name) + expect(page).not_to have_content(budget2.name) + expect(page).not_to have_content(budget3.name) + expect(page).not_to have_content(budget4.name) expect(page).to have_content(budget5.name) click_link 'Open' @@ -59,7 +59,7 @@ feature 'Admin budgets' do expect(page).to have_content(budget2.name) expect(page).to have_content(budget3.name) expect(page).to have_content(budget4.name) - expect(page).to_not have_content(budget5.name) + expect(page).not_to have_content(budget5.name) end scenario 'Open filter is properly highlighted' do @@ -67,13 +67,13 @@ feature 'Admin budgets' do visit admin_budgets_path - expect(page).to_not have_link(filters_links.values.first) + expect(page).not_to have_link(filters_links.values.first) filters_links.keys.drop(1).each { |filter| expect(page).to have_link(filters_links[filter]) } filters_links.each_pair do |current_filter, link| visit admin_budgets_path(filter: current_filter) - expect(page).to_not have_link(link) + expect(page).not_to have_link(link) (filters_links.keys - [current_filter]).each do |filter| expect(page).to have_link(filters_links[filter]) @@ -103,7 +103,7 @@ feature 'Admin budgets' do visit new_admin_budget_path click_button 'Create Participatory budget' - expect(page).to_not have_content 'New participatory budget created successfully!' + expect(page).not_to have_content 'New participatory budget created successfully!' expect(page).to have_css("label.error", text: "Name") end @@ -158,7 +158,7 @@ feature 'Admin budgets' do expect(page).to have_content '1 Group of budget headings' expect(page).to have_content 'Health' expect(page).to have_content 'Yearly participatory budget' - expect(page).to_not have_content 'No groups created yet.' + expect(page).not_to have_content 'No groups created yet.' visit admin_budgets_path within("#budget_#{budget.id}") do @@ -168,7 +168,7 @@ feature 'Admin budgets' do expect(page).to have_content '1 Group of budget headings' expect(page).to have_content 'Health' expect(page).to have_content 'Yearly participatory budget' - expect(page).to_not have_content 'No groups created yet.' + expect(page).not_to have_content 'No groups created yet.' end scenario 'Create heading', :js do @@ -187,11 +187,11 @@ feature 'Admin budgets' do click_button 'Save heading' end - expect(page).to_not have_content 'This group has no assigned heading.' + expect(page).not_to have_content 'This group has no assigned heading.' visit admin_budget_path(budget) within("#budget_group_#{group.id}") do - expect(page).to_not have_content 'This group has no assigned heading.' + expect(page).not_to have_content 'This group has no assigned heading.' expect(page).to have_content 'District 9 reconstruction' expect(page).to have_content '6785' diff --git a/spec/features/admin/comments_spec.rb b/spec/features/admin/comments_spec.rb index 3de3395d0..e6e603378 100644 --- a/spec/features/admin/comments_spec.rb +++ b/spec/features/admin/comments_spec.rb @@ -22,7 +22,7 @@ feature 'Admin comments' do end visit admin_comments_path - expect(page).to_not have_content("SPAM from SPAMMER") + expect(page).not_to have_content("SPAM from SPAMMER") expect(page).not_to have_content("Good Proposal!") end @@ -32,9 +32,9 @@ feature 'Admin comments' do click_link 'Restore' - expect(page).to_not have_content(comment.body) + expect(page).not_to have_content(comment.body) - expect(comment.reload).to_not be_hidden + expect(comment.reload).not_to be_hidden expect(comment).to be_ignored_flag end @@ -44,7 +44,7 @@ feature 'Admin comments' do click_link 'Confirm' - expect(page).to_not have_content(comment.body) + expect(page).not_to have_content(comment.body) click_link('Confirmed') expect(page).to have_content(comment.body) @@ -53,24 +53,24 @@ feature 'Admin comments' do scenario "Current filter is properly highlighted" do visit admin_comments_path - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('All') expect(page).to have_link('Confirmed') visit admin_comments_path(filter: 'Pending') - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('All') expect(page).to have_link('Confirmed') visit admin_comments_path(filter: 'all') expect(page).to have_link('Pending') - expect(page).to_not have_link('All') + expect(page).not_to have_link('All') expect(page).to have_link('Confirmed') visit admin_comments_path(filter: 'with_confirmed_hide') expect(page).to have_link('Pending') expect(page).to have_link('All') - expect(page).to_not have_link('Confirmed') + expect(page).not_to have_link('Confirmed') end scenario "Filtering comments" do @@ -82,7 +82,7 @@ feature 'Admin comments' do expect(page).to have_content('Confirmed comment') visit admin_comments_path(filter: 'with_confirmed_hide') - expect(page).to_not have_content('Unconfirmed comment') + expect(page).not_to have_content('Unconfirmed comment') expect(page).to have_content('Confirmed comment') end diff --git a/spec/features/admin/debates_spec.rb b/spec/features/admin/debates_spec.rb index cb23ee788..45d2040c6 100644 --- a/spec/features/admin/debates_spec.rb +++ b/spec/features/admin/debates_spec.rb @@ -23,9 +23,9 @@ feature 'Admin debates' do click_link 'Restore' - expect(page).to_not have_content(debate.title) + expect(page).not_to have_content(debate.title) - expect(debate.reload).to_not be_hidden + expect(debate.reload).not_to be_hidden expect(debate).to be_ignored_flag end @@ -35,7 +35,7 @@ feature 'Admin debates' do click_link 'Confirm' - expect(page).to_not have_content(debate.title) + expect(page).not_to have_content(debate.title) click_link('Confirmed') expect(page).to have_content(debate.title) @@ -44,24 +44,24 @@ feature 'Admin debates' do scenario "Current filter is properly highlighted" do visit admin_debates_path - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('All') expect(page).to have_link('Confirmed') visit admin_debates_path(filter: 'Pending') - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('All') expect(page).to have_link('Confirmed') visit admin_debates_path(filter: 'all') expect(page).to have_link('Pending') - expect(page).to_not have_link('All') + expect(page).not_to have_link('All') expect(page).to have_link('Confirmed') visit admin_debates_path(filter: 'with_confirmed_hide') expect(page).to have_link('All') expect(page).to have_link('Pending') - expect(page).to_not have_link('Confirmed') + expect(page).not_to have_link('Confirmed') end scenario "Filtering debates" do @@ -70,14 +70,14 @@ feature 'Admin debates' do visit admin_debates_path(filter: 'pending') expect(page).to have_content('Unconfirmed debate') - expect(page).to_not have_content('Confirmed debate') + expect(page).not_to have_content('Confirmed debate') visit admin_debates_path(filter: 'all') expect(page).to have_content('Unconfirmed debate') expect(page).to have_content('Confirmed debate') visit admin_debates_path(filter: 'with_confirmed_hide') - expect(page).to_not have_content('Unconfirmed debate') + expect(page).not_to have_content('Unconfirmed debate') expect(page).to have_content('Confirmed debate') end diff --git a/spec/features/admin/feature_flags_spec.rb b/spec/features/admin/feature_flags_spec.rb index 99c460477..89d20d052 100644 --- a/spec/features/admin/feature_flags_spec.rb +++ b/spec/features/admin/feature_flags_spec.rb @@ -29,7 +29,7 @@ feature 'Admin feature flags' do within("#edit_setting_#{setting_id}") do expect(page).to have_button "Disable" - expect(page).to_not have_button "Enable" + expect(page).not_to have_button "Enable" click_button 'Disable' end @@ -59,7 +59,7 @@ feature 'Admin feature flags' do within("#edit_setting_#{setting_id}") do expect(page).to have_button "Enable" - expect(page).to_not have_button "Disable" + expect(page).not_to have_button "Disable" click_button 'Enable' end diff --git a/spec/features/admin/hidden_users_spec.rb b/spec/features/admin/hidden_users_spec.rb index f229bd833..0f41e3573 100644 --- a/spec/features/admin/hidden_users_spec.rb +++ b/spec/features/admin/hidden_users_spec.rb @@ -29,9 +29,9 @@ feature 'Admin hidden users' do click_link 'Restore' - expect(page).to_not have_content(user.username) + expect(page).not_to have_content(user.username) - expect(user.reload).to_not be_hidden + expect(user.reload).not_to be_hidden end scenario 'Confirm hide' do @@ -40,7 +40,7 @@ feature 'Admin hidden users' do click_link 'Confirm' - expect(page).to_not have_content(user.username) + expect(page).not_to have_content(user.username) click_link('Confirmed') expect(page).to have_content(user.username) @@ -49,24 +49,24 @@ feature 'Admin hidden users' do scenario "Current filter is properly highlighted" do visit admin_hidden_users_path - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('All') expect(page).to have_link('Confirmed') visit admin_hidden_users_path(filter: 'Pending') - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('All') expect(page).to have_link('Confirmed') visit admin_hidden_users_path(filter: 'all') expect(page).to have_link('Pending') - expect(page).to_not have_link('All') + expect(page).not_to have_link('All') expect(page).to have_link('Confirmed') visit admin_hidden_users_path(filter: 'with_confirmed_hide') expect(page).to have_link('All') expect(page).to have_link('Pending') - expect(page).to_not have_link('Confirmed') + expect(page).not_to have_link('Confirmed') end scenario "Filtering users" do @@ -78,7 +78,7 @@ feature 'Admin hidden users' do expect(page).to have_content('Confirmed user') visit admin_hidden_users_path(filter: 'with_confirmed_hide') - expect(page).to_not have_content('Unconfirmed') + expect(page).not_to have_content('Unconfirmed') expect(page).to have_content('Confirmed user') end diff --git a/spec/features/admin/legislation/processes_spec.rb b/spec/features/admin/legislation/processes_spec.rb index 8ad2fa456..d968d3e8f 100644 --- a/spec/features/admin/legislation/processes_spec.rb +++ b/spec/features/admin/legislation/processes_spec.rb @@ -34,7 +34,7 @@ feature 'Admin legislation processes' do click_link "Collaborative Legislation" end - expect(page).to_not have_content 'An example legislation process' + expect(page).not_to have_content 'An example legislation process' click_link "New process" diff --git a/spec/features/admin/legislation/questions_spec.rb b/spec/features/admin/legislation/questions_spec.rb index ffbca09b1..d79429e30 100644 --- a/spec/features/admin/legislation/questions_spec.rb +++ b/spec/features/admin/legislation/questions_spec.rb @@ -108,7 +108,7 @@ feature 'Admin legislation questions' do expect(page).to have_content 'Questions' expect(page).to have_content 'Question 1' - expect(page).to_not have_content 'Question 2' + expect(page).not_to have_content 'Question 2' end end end diff --git a/spec/features/admin/managers_spec.rb b/spec/features/admin/managers_spec.rb index e59b1da4c..24baafca6 100644 --- a/spec/features/admin/managers_spec.rb +++ b/spec/features/admin/managers_spec.rb @@ -12,7 +12,7 @@ feature 'Admin managers' do scenario 'Index' do expect(page).to have_content @manager.name expect(page).to have_content @manager.email - expect(page).to_not have_content @user.name + expect(page).not_to have_content @user.name end scenario 'Create Manager', :js do @@ -30,7 +30,7 @@ feature 'Admin managers' do click_link 'Delete' within("#managers") do - expect(page).to_not have_content @manager.name + expect(page).not_to have_content @manager.name end end @@ -53,8 +53,8 @@ feature 'Admin managers' do expect(page).to have_content('Managers: User search') expect(page).to have_content('No results found') - expect(page).to_not have_content(@manager1.name) - expect(page).to_not have_content(@manager2.name) + expect(page).not_to have_content(@manager1.name) + expect(page).not_to have_content(@manager2.name) end scenario 'search by name' do @@ -66,7 +66,7 @@ feature 'Admin managers' do expect(page).to have_content('Managers: User search') expect(page).to have_content(@manager1.name) - expect(page).to_not have_content(@manager2.name) + expect(page).not_to have_content(@manager2.name) end scenario 'search by email' do @@ -78,7 +78,7 @@ feature 'Admin managers' do expect(page).to have_content('Managers: User search') expect(page).to have_content(@manager2.email) - expect(page).to_not have_content(@manager1.email) + expect(page).not_to have_content(@manager1.email) end end diff --git a/spec/features/admin/moderators_spec.rb b/spec/features/admin/moderators_spec.rb index 8a32762f1..aa45f7011 100644 --- a/spec/features/admin/moderators_spec.rb +++ b/spec/features/admin/moderators_spec.rb @@ -12,7 +12,7 @@ feature 'Admin moderators' do scenario 'Index' do expect(page).to have_content @moderator.name expect(page).to have_content @moderator.email - expect(page).to_not have_content @user.name + expect(page).not_to have_content @user.name end scenario 'Create Moderator', :js do @@ -30,7 +30,7 @@ feature 'Admin moderators' do click_link 'Delete' within("#moderators") do - expect(page).to_not have_content @moderator.name + expect(page).not_to have_content @moderator.name end end @@ -53,8 +53,8 @@ feature 'Admin moderators' do expect(page).to have_content('Moderators: User search') expect(page).to have_content('No results found') - expect(page).to_not have_content(@moderator1.name) - expect(page).to_not have_content(@moderator2.name) + expect(page).not_to have_content(@moderator1.name) + expect(page).not_to have_content(@moderator2.name) end scenario 'search by name' do @@ -66,7 +66,7 @@ feature 'Admin moderators' do expect(page).to have_content('Moderators: User search') expect(page).to have_content(@moderator1.name) - expect(page).to_not have_content(@moderator2.name) + expect(page).not_to have_content(@moderator2.name) end scenario 'search by email' do @@ -78,7 +78,7 @@ feature 'Admin moderators' do expect(page).to have_content('Moderators: User search') expect(page).to have_content(@moderator2.email) - expect(page).to_not have_content(@moderator1.email) + expect(page).not_to have_content(@moderator1.email) end end diff --git a/spec/features/admin/officials_spec.rb b/spec/features/admin/officials_spec.rb index 78f807445..5b5a5c32f 100644 --- a/spec/features/admin/officials_spec.rb +++ b/spec/features/admin/officials_spec.rb @@ -13,7 +13,7 @@ feature 'Admin officials' do visit admin_officials_path expect(page).to have_content @official.name - expect(page).to_not have_content @citizen.name + expect(page).not_to have_content @citizen.name expect(page).to have_content @official.official_position expect(page).to have_content @official.official_level end @@ -24,7 +24,7 @@ feature 'Admin officials' do expect(page).to have_current_path(edit_admin_official_path(@official)) - expect(page).to_not have_content @citizen.name + expect(page).not_to have_content @citizen.name expect(page).to have_content @official.name expect(page).to have_content @official.email @@ -47,7 +47,7 @@ feature 'Admin officials' do click_button 'Search' expect(page).to have_current_path(search_admin_officials_path, only_path: true) - expect(page).to_not have_content @official.name + expect(page).not_to have_content @official.name click_link @citizen.name @@ -72,7 +72,7 @@ feature 'Admin officials' do expect(page).to have_content 'Details saved: the user is no longer an official' expect(page).to have_current_path(admin_officials_path, only_path: true) - expect(page).to_not have_content @citizen.name - expect(page).to_not have_content @official.name + expect(page).not_to have_content @citizen.name + expect(page).not_to have_content @official.name end end diff --git a/spec/features/admin/organizations_spec.rb b/spec/features/admin/organizations_spec.rb index 9979d564d..baf978ffc 100644 --- a/spec/features/admin/organizations_spec.rb +++ b/spec/features/admin/organizations_spec.rb @@ -20,8 +20,8 @@ feature 'Admin::Organizations' do expect(page).to have_content("Human Rights") expect(page).to have_content(org.user.email) - expect(page).to_not have_content("Greentroll") - expect(page).to_not have_content("trol@troller.com") + expect(page).not_to have_content("Greentroll") + expect(page).not_to have_content("trol@troller.com") expect(page).to have_content("There is also one organisation with no users or with a hidden user") end end @@ -42,13 +42,13 @@ feature 'Admin::Organizations' do expect(page).to have_current_path(search_admin_organizations_path, only_path: true) within("#search-results") do - expect(page).to_not have_content("Get up, Stand up") + expect(page).not_to have_content("Get up, Stand up") end end scenario "finds by name" do visit search_admin_organizations_path - expect(page).to_not have_content("Get up, Stand up") + expect(page).not_to have_content("Get up, Stand up") fill_in "term", with: "Up, sta" click_button "Search" @@ -60,7 +60,7 @@ feature 'Admin::Organizations' do scenario "finds by users email" do visit search_admin_organizations_path - expect(page).to_not have_content("Get up, Stand up") + expect(page).not_to have_content("Get up, Stand up") fill_in "term", with: @user.email click_button "Search" @@ -72,7 +72,7 @@ feature 'Admin::Organizations' do scenario "finds by users phone number" do visit search_admin_organizations_path - expect(page).to_not have_content("Get up, Stand up") + expect(page).not_to have_content("Get up, Stand up") fill_in "term", with: @user.phone_number click_button "Search" @@ -109,13 +109,13 @@ feature 'Admin::Organizations' do within("#organization_#{organization.id}") do expect(page).to have_content 'Verified' - expect(page).to_not have_link('Verify') + expect(page).not_to have_link('Verify') expect(page).to have_link('Reject') click_on 'Reject' end expect(page).to have_current_path(admin_organizations_path, only_path: true) - expect(page).to_not have_content organization.name + expect(page).not_to have_content organization.name click_on 'Rejected' expect(page).to have_content 'Rejected' @@ -132,12 +132,12 @@ feature 'Admin::Organizations' do within("#organization_#{organization.id}") do expect(page).to have_link('Verify') - expect(page).to_not have_link('Reject', exact: true) + expect(page).not_to have_link('Reject', exact: true) click_on 'Verify' end expect(page).to have_current_path(admin_organizations_path, only_path: true) - expect(page).to_not have_content organization.name + expect(page).not_to have_content organization.name click_on('Verified') expect(page).to have_content organization.name @@ -147,34 +147,34 @@ feature 'Admin::Organizations' do scenario "Current filter is properly highlighted" do visit admin_organizations_path - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('All') expect(page).to have_link('Verified') expect(page).to have_link('Rejected') visit admin_organizations_path(filter: 'all') - expect(page).to_not have_link('All') + expect(page).not_to have_link('All') expect(page).to have_link('Pending') expect(page).to have_link('Verified') expect(page).to have_link('Rejected') visit admin_organizations_path(filter: 'pending') expect(page).to have_link('All') - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('Verified') expect(page).to have_link('Rejected') visit admin_organizations_path(filter: 'verified') expect(page).to have_link('All') expect(page).to have_link('Pending') - expect(page).to_not have_link('Verified') + expect(page).not_to have_link('Verified') expect(page).to have_link('Rejected') visit admin_organizations_path(filter: 'rejected') expect(page).to have_link('All') expect(page).to have_link('Pending') expect(page).to have_link('Verified') - expect(page).to_not have_link('Rejected') + expect(page).not_to have_link('Rejected') end scenario "Filtering organizations" do @@ -189,18 +189,18 @@ feature 'Admin::Organizations' do visit admin_organizations_path(filter: 'pending') expect(page).to have_content('Pending Organization') - expect(page).to_not have_content('Rejected Organization') - expect(page).to_not have_content('Verified Organization') + expect(page).not_to have_content('Rejected Organization') + expect(page).not_to have_content('Verified Organization') visit admin_organizations_path(filter: 'verified') - expect(page).to_not have_content('Pending Organization') - expect(page).to_not have_content('Rejected Organization') + expect(page).not_to have_content('Pending Organization') + expect(page).not_to have_content('Rejected Organization') expect(page).to have_content('Verified Organization') visit admin_organizations_path(filter: 'rejected') - expect(page).to_not have_content('Pending Organization') + expect(page).not_to have_content('Pending Organization') expect(page).to have_content('Rejected Organization') - expect(page).to_not have_content('Verified Organization') + expect(page).not_to have_content('Verified Organization') end scenario "Verifying organization links remember the pagination setting and the filter" do diff --git a/spec/features/admin/poll/booth_assigments_spec.rb b/spec/features/admin/poll/booth_assigments_spec.rb index 016bccb7f..9d3f4180b 100644 --- a/spec/features/admin/poll/booth_assigments_spec.rb +++ b/spec/features/admin/poll/booth_assigments_spec.rb @@ -38,7 +38,7 @@ feature 'Admin booths assignments' do end expect(page).to have_content 'There are no booths assigned to this poll.' - expect(page).to_not have_content booth.name + expect(page).not_to have_content booth.name fill_in 'search-booths', with: booth.name click_button 'Search' @@ -64,7 +64,7 @@ feature 'Admin booths assignments' do click_link 'Booths (1)' end - expect(page).to_not have_content 'There are no booths assigned to this poll.' + expect(page).not_to have_content 'There are no booths assigned to this poll.' expect(page).to have_content booth.name end @@ -163,7 +163,7 @@ feature 'Admin booths assignments' do click_link 'Officers' within('#officers_list') do expect(page).to have_content officer.name - expect(page).to_not have_content officer_2.name + expect(page).not_to have_content officer_2.name end end diff --git a/spec/features/admin/poll/booths_spec.rb b/spec/features/admin/poll/booths_spec.rb index b706e23ce..ba7ca5cfb 100644 --- a/spec/features/admin/poll/booths_spec.rb +++ b/spec/features/admin/poll/booths_spec.rb @@ -33,7 +33,7 @@ feature 'Admin booths' do expect(page).to have_content booth.location end end - expect(page).to_not have_content "There are no booths" + expect(page).not_to have_content "There are no booths" end scenario "Available" do @@ -59,8 +59,8 @@ feature 'Admin booths' do expect(page).to have_content booth_for_current_poll.name expect(page).to have_content booth_for_incoming_poll.name - expect(page).to_not have_content booth_for_expired_poll.name - expect(page).to_not have_link "Edit booth" + expect(page).not_to have_content booth_for_expired_poll.name + expect(page).not_to have_link "Edit booth" end scenario 'Show' do @@ -95,7 +95,7 @@ feature 'Admin booths' do visit admin_booths_path within("#booth_#{booth.id}") do - expect(page).to_not have_link "Manage shifts" + expect(page).not_to have_link "Manage shifts" click_link "Edit booth" end diff --git a/spec/features/admin/poll/officer_assignments_spec.rb b/spec/features/admin/poll/officer_assignments_spec.rb index 48d10ad39..d95fc8aa5 100644 --- a/spec/features/admin/poll/officer_assignments_spec.rb +++ b/spec/features/admin/poll/officer_assignments_spec.rb @@ -28,7 +28,7 @@ feature 'Officer Assignments' do within('#officer_assignments') do expect(page).to have_content officer1.name expect(page).to have_content officer2.name - expect(page).to_not have_content officer3.name + expect(page).not_to have_content officer3.name end end @@ -60,7 +60,7 @@ feature 'Officer Assignments' do within('#search-officers-results') do expect(page).to have_content officer1.name expect(page).to have_content officer2.name - expect(page).to_not have_content officer3.name + expect(page).not_to have_content officer3.name end end diff --git a/spec/features/admin/poll/officers_spec.rb b/spec/features/admin/poll/officers_spec.rb index d9ea89638..cfa0ff1ae 100644 --- a/spec/features/admin/poll/officers_spec.rb +++ b/spec/features/admin/poll/officers_spec.rb @@ -13,7 +13,7 @@ feature 'Admin poll officers' do scenario 'Index' do expect(page).to have_content @officer.name expect(page).to have_content @officer.email - expect(page).to_not have_content @user.name + expect(page).not_to have_content @user.name end scenario 'Create', :js do @@ -30,7 +30,7 @@ feature 'Admin poll officers' do scenario 'Delete' do click_link 'Delete position' - expect(page).to_not have_css '#officers' + expect(page).not_to have_css '#officers' end end \ No newline at end of file diff --git a/spec/features/admin/poll/polls_spec.rb b/spec/features/admin/poll/polls_spec.rb index de1399cac..482d461cc 100644 --- a/spec/features/admin/poll/polls_spec.rb +++ b/spec/features/admin/poll/polls_spec.rb @@ -36,7 +36,7 @@ feature 'Admin polls' do expect(page).to have_content poll.name end end - expect(page).to_not have_content "There are no polls" + expect(page).not_to have_content "There are no polls" end scenario 'Show' do @@ -61,8 +61,8 @@ feature 'Admin polls' do fill_in 'poll_summary', with: "Upcoming poll's summary. This poll..." fill_in 'poll_description', with: "Upcomming poll's description. This poll..." - expect(page).to_not have_css("#poll_results_enabled") - expect(page).to_not have_css("#poll_stats_enabled") + expect(page).not_to have_css("#poll_results_enabled") + expect(page).not_to have_css("#poll_stats_enabled") click_button "Create poll" @@ -142,7 +142,7 @@ feature 'Admin polls' do expect(page).to have_content ba.booth.location end end - expect(page).to_not have_content "There are no booths assigned to this poll." + expect(page).not_to have_content "There are no booths assigned to this poll." end end end @@ -180,7 +180,7 @@ feature 'Admin polls' do expect(page).to have_content officer.email end end - expect(page).to_not have_content "There are no officers assigned to this poll" + expect(page).not_to have_content "There are no officers assigned to this poll" end end end @@ -198,8 +198,8 @@ feature 'Admin polls' do expect(page).to have_content "Questions (1)" expect(page).to have_content question.title - expect(page).to_not have_content other_question.title - expect(page).to_not have_content "There are no questions assigned to this poll" + expect(page).not_to have_content other_question.title + expect(page).not_to have_content "There are no questions assigned to this poll" end end diff --git a/spec/features/admin/poll/questions/answers/answers_spec.rb b/spec/features/admin/poll/questions/answers/answers_spec.rb index e8af5ff79..288f514a4 100644 --- a/spec/features/admin/poll/questions/answers/answers_spec.rb +++ b/spec/features/admin/poll/questions/answers/answers_spec.rb @@ -63,7 +63,7 @@ feature 'Answers' do visit admin_question_path(question) expect(page).to have_content(new_title) - expect(page).to_not have_content(old_title) + expect(page).not_to have_content(old_title) expect(page.body.index(new_title)).to be < page.body.index(answer2.title) end diff --git a/spec/features/admin/poll/questions_spec.rb b/spec/features/admin/poll/questions_spec.rb index 910bda2f1..8b251a440 100644 --- a/spec/features/admin/poll/questions_spec.rb +++ b/spec/features/admin/poll/questions_spec.rb @@ -92,7 +92,7 @@ feature 'Admin poll questions' do visit admin_questions_path expect(page).to have_content(new_title) - expect(page).to_not have_content(old_title) + expect(page).not_to have_content(old_title) end scenario 'Destroy' do @@ -105,7 +105,7 @@ feature 'Admin poll questions' do click_link "Delete" end - expect(page).to_not have_content(question1.title) + expect(page).not_to have_content(question1.title) expect(page).to have_content(question2.title) end diff --git a/spec/features/admin/proposals_spec.rb b/spec/features/admin/proposals_spec.rb index df70572a4..0c65aa899 100644 --- a/spec/features/admin/proposals_spec.rb +++ b/spec/features/admin/proposals_spec.rb @@ -35,9 +35,9 @@ feature 'Admin proposals' do click_link 'Restore' - expect(page).to_not have_content(proposal.title) + expect(page).not_to have_content(proposal.title) - expect(proposal.reload).to_not be_hidden + expect(proposal.reload).not_to be_hidden expect(proposal).to be_ignored_flag end @@ -47,7 +47,7 @@ feature 'Admin proposals' do click_link 'Confirm' - expect(page).to_not have_content(proposal.title) + expect(page).not_to have_content(proposal.title) click_link('Confirmed') expect(page).to have_content(proposal.title) @@ -56,24 +56,24 @@ feature 'Admin proposals' do scenario "Current filter is properly highlighted" do visit admin_proposals_path - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('All') expect(page).to have_link('Confirmed') visit admin_proposals_path(filter: 'Pending') - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('All') expect(page).to have_link('Confirmed') visit admin_proposals_path(filter: 'all') expect(page).to have_link('Pending') - expect(page).to_not have_link('All') + expect(page).not_to have_link('All') expect(page).to have_link('Confirmed') visit admin_proposals_path(filter: 'with_confirmed_hide') expect(page).to have_link('All') expect(page).to have_link('Pending') - expect(page).to_not have_link('Confirmed') + expect(page).not_to have_link('Confirmed') end scenario "Filtering proposals" do @@ -82,14 +82,14 @@ feature 'Admin proposals' do visit admin_proposals_path(filter: 'pending') expect(page).to have_content('Unconfirmed proposal') - expect(page).to_not have_content('Confirmed proposal') + expect(page).not_to have_content('Confirmed proposal') visit admin_proposals_path(filter: 'all') expect(page).to have_content('Unconfirmed proposal') expect(page).to have_content('Confirmed proposal') visit admin_proposals_path(filter: 'with_confirmed_hide') - expect(page).to_not have_content('Unconfirmed proposal') + expect(page).not_to have_content('Unconfirmed proposal') expect(page).to have_content('Confirmed proposal') end diff --git a/spec/features/admin/site_customization/content_blocks_spec.rb b/spec/features/admin/site_customization/content_blocks_spec.rb index de2155737..eb6098ed4 100644 --- a/spec/features/admin/site_customization/content_blocks_spec.rb +++ b/spec/features/admin/site_customization/content_blocks_spec.rb @@ -23,7 +23,7 @@ feature "Admin custom content blocks" do click_link "Custom content blocks" end - expect(page).to_not have_content "footer (es)" + expect(page).not_to have_content "footer (es)" click_link "Create new content block" @@ -90,8 +90,8 @@ feature "Admin custom content blocks" do click_button "Delete block" - expect(page).to_not have_content("#{block.name} (#{block.locale})") - expect(page).to_not have_content(block.body) + expect(page).not_to have_content("#{block.name} (#{block.locale})") + expect(page).not_to have_content(block.body) end scenario "From edit page" do @@ -100,8 +100,8 @@ feature "Admin custom content blocks" do click_button "Delete block" - expect(page).to_not have_content("#{block.name} (#{block.locale})") - expect(page).to_not have_content(block.body) + expect(page).not_to have_content("#{block.name} (#{block.locale})") + expect(page).not_to have_content(block.body) end end end diff --git a/spec/features/admin/site_customization/images_spec.rb b/spec/features/admin/site_customization/images_spec.rb index fc81bf246..cd8c0c065 100644 --- a/spec/features/admin/site_customization/images_spec.rb +++ b/spec/features/admin/site_customization/images_spec.rb @@ -57,6 +57,6 @@ feature "Admin custom images" do click_link "Delete" end - expect(page).to_not have_css("img[src*='social_media_icon.png']") + expect(page).not_to have_css("img[src*='social_media_icon.png']") end end diff --git a/spec/features/admin/site_customization/pages_spec.rb b/spec/features/admin/site_customization/pages_spec.rb index 1b09a8f01..d4873be9d 100644 --- a/spec/features/admin/site_customization/pages_spec.rb +++ b/spec/features/admin/site_customization/pages_spec.rb @@ -22,7 +22,7 @@ feature "Admin custom pages" do click_link "Custom Pages" end - expect(page).to_not have_content "An example custom page" + expect(page).not_to have_content "An example custom page" click_link "Create new page" @@ -65,6 +65,6 @@ feature "Admin custom pages" do click_button "Delete page" - expect(page).to_not have_content("An example custom page") + expect(page).not_to have_content("An example custom page") end end diff --git a/spec/features/admin/tags_spec.rb b/spec/features/admin/tags_spec.rb index 8ff205852..e22637675 100644 --- a/spec/features/admin/tags_spec.rb +++ b/spec/features/admin/tags_spec.rb @@ -19,7 +19,7 @@ feature 'Admin tags' do scenario 'Create' do visit admin_tags_path - expect(page).to_not have_content 'important issues' + expect(page).not_to have_content 'important issues' within("form.new_tag") do fill_in "tag_name", with: 'important issues' @@ -45,7 +45,7 @@ feature 'Admin tags' do visit admin_tags_path expect(page).to have_content @tag1.name - expect(page).to_not have_content tag2.name + expect(page).not_to have_content tag2.name end scenario 'Delete tag with hidden taggables' do @@ -64,7 +64,7 @@ feature 'Admin tags' do visit admin_tags_path expect(page).to have_content @tag1.name - expect(page).to_not have_content tag2.name + expect(page).not_to have_content tag2.name end context "Manage only tags of kind category" do @@ -73,7 +73,7 @@ feature 'Admin tags' do visit admin_tags_path expect(page).to have_content @tag1.name - expect(page).to_not have_content "Not a category" + expect(page).not_to have_content "Not a category" end scenario "Create instanciates tags of correct kind" do diff --git a/spec/features/admin/users_spec.rb b/spec/features/admin/users_spec.rb index 4a62a75d0..98058701e 100644 --- a/spec/features/admin/users_spec.rb +++ b/spec/features/admin/users_spec.rb @@ -21,8 +21,8 @@ feature 'Admin users' do expect(page).to have_content @user.name expect(page).to have_content @user.email - expect(page).to_not have_content @admin.name - expect(page).to_not have_content @admin.email + expect(page).not_to have_content @admin.name + expect(page).not_to have_content @admin.email end end diff --git a/spec/features/admin/valuators_spec.rb b/spec/features/admin/valuators_spec.rb index f1dfa68b3..25ae57a12 100644 --- a/spec/features/admin/valuators_spec.rb +++ b/spec/features/admin/valuators_spec.rb @@ -12,7 +12,7 @@ feature 'Admin valuators' do scenario 'Index' do expect(page).to have_content(@valuator.name) expect(page).to have_content(@valuator.email) - expect(page).to_not have_content(@user.name) + expect(page).not_to have_content(@user.name) end scenario 'Create Valuator', :js do @@ -33,7 +33,7 @@ feature 'Admin valuators' do click_link 'Delete' within('#valuators') do - expect(page).to_not have_content(@valuator.name) + expect(page).not_to have_content(@valuator.name) end end @@ -56,8 +56,8 @@ feature 'Admin valuators' do expect(page).to have_content('Valuators: User search') expect(page).to have_content('No results found') - expect(page).to_not have_content(@valuator1.name) - expect(page).to_not have_content(@valuator2.name) + expect(page).not_to have_content(@valuator1.name) + expect(page).not_to have_content(@valuator2.name) end scenario 'search by name' do @@ -69,7 +69,7 @@ feature 'Admin valuators' do expect(page).to have_content('Valuators: User search') expect(page).to have_content(@valuator1.name) - expect(page).to_not have_content(@valuator2.name) + expect(page).not_to have_content(@valuator2.name) end scenario 'search by email' do @@ -81,7 +81,7 @@ feature 'Admin valuators' do expect(page).to have_content('Valuators: User search') expect(page).to have_content(@valuator2.email) - expect(page).to_not have_content(@valuator1.email) + expect(page).not_to have_content(@valuator1.email) end end diff --git a/spec/features/admin/verifications_spec.rb b/spec/features/admin/verifications_spec.rb index ce455fe87..94218426d 100644 --- a/spec/features/admin/verifications_spec.rb +++ b/spec/features/admin/verifications_spec.rb @@ -17,8 +17,8 @@ feature 'Incomplete verifications' do expect(page).to have_content(incompletely_verified_user1.username) expect(page).to have_content(incompletely_verified_user2.username) - expect(page).to_not have_content(never_tried_to_verify_user.username) - expect(page).to_not have_content(verified_user.username) + expect(page).not_to have_content(never_tried_to_verify_user.username) + expect(page).not_to have_content(verified_user.username) end scenario 'Search' do @@ -32,8 +32,8 @@ feature 'Incomplete verifications' do click_button "Search" expect(page).to have_content("Juan_anonymous") - expect(page).to_not have_content("Juan Carlos") - expect(page).to_not have_content("Isabel_anonymous") + expect(page).not_to have_content("Juan Carlos") + expect(page).not_to have_content("Isabel_anonymous") end scenario "Residence unverified" do diff --git a/spec/features/admin_spec.rb b/spec/features/admin_spec.rb index 006f70863..82130cda4 100644 --- a/spec/features/admin_spec.rb +++ b/spec/features/admin_spec.rb @@ -61,7 +61,7 @@ feature 'Admin' do visit admin_root_path expect(page).to have_current_path(admin_root_path) - expect(page).to_not have_content "You do not have permission to access this page" + expect(page).not_to have_content "You do not have permission to access this page" end scenario "Admin access links" do @@ -86,8 +86,8 @@ feature 'Admin' do expect(page).to have_current_path(admin_root_path) expect(page).to have_css('#admin_menu') - expect(page).to_not have_css('#moderation_menu') - expect(page).to_not have_css('#valuation_menu') + expect(page).not_to have_css('#moderation_menu') + expect(page).not_to have_css('#valuation_menu') end end diff --git a/spec/features/budgets/ballots_spec.rb b/spec/features/budgets/ballots_spec.rb index 3a710fcb4..8fd3cfcf0 100644 --- a/spec/features/budgets/ballots_spec.rb +++ b/spec/features/budgets/ballots_spec.rb @@ -156,8 +156,8 @@ feature 'Ballots' do expect(page).to have_css("#amount-available", text: "€1,000,000") within("#sidebar") do - expect(page).to_not have_content investment.title - expect(page).to_not have_content "€10,000" + expect(page).not_to have_content investment.title + expect(page).not_to have_content "€10,000" end end @@ -204,8 +204,8 @@ feature 'Ballots' do expect(page).to have_content investment2.title expect(page).to have_content "€20,000" - expect(page).to_not have_content investment1.title - expect(page).to_not have_content "€10,000" + expect(page).not_to have_content investment1.title + expect(page).not_to have_content "€10,000" end visit budget_path(budget) @@ -218,8 +218,8 @@ feature 'Ballots' do expect(page).to have_content investment1.title expect(page).to have_content "€10,000" - expect(page).to_not have_content investment2.title - expect(page).to_not have_content "€20,000" + expect(page).not_to have_content investment2.title + expect(page).not_to have_content "€20,000" end visit budget_path(budget) @@ -284,7 +284,7 @@ feature 'Ballots' do visit budget_path(budget) click_link "States" expect(page).to have_css("#budget_heading_#{new_york.id}.active") - expect(page).to_not have_css("#budget_heading_#{california.id}.active") + expect(page).not_to have_css("#budget_heading_#{california.id}.active") end scenario 'View another heading' do @@ -295,7 +295,7 @@ feature 'Ballots' do visit budget_investments_path(budget, heading_id: new_york.id) - expect(page).to_not have_css "#progressbar" + expect(page).not_to have_css "#progressbar" expect(page).to have_content "You have active votes in another heading:" expect(page).to have_link california.name, href: budget_investments_path(budget, heading_id: california.id) end @@ -411,8 +411,8 @@ feature 'Ballots' do expect(page).to have_css("#amount-available", text: "€980,000") within("#sidebar") do - expect(page).to_not have_content investment1.title - expect(page).to_not have_content "€10,000" + expect(page).not_to have_content investment1.title + expect(page).not_to have_content "€10,000" expect(page).to have_content investment2.title expect(page).to have_content "€20,000" @@ -490,7 +490,7 @@ feature 'Ballots' do click_link states.name click_link new_york.name - expect(page).to_not have_css("#budget_investment_#{investment.id}") + expect(page).not_to have_css("#budget_investment_#{investment.id}") end scenario 'Investments with feasibility undecided are not shown' do @@ -502,8 +502,8 @@ feature 'Ballots' do click_link new_york.name within("#budget-investments") do - expect(page).to_not have_css("div.ballot") - expect(page).to_not have_css("#budget_investment_#{investment.id}") + expect(page).not_to have_css("div.ballot") + expect(page).not_to have_css("#budget_investment_#{investment.id}") end end @@ -550,7 +550,7 @@ feature 'Ballots' do within("#budget_investment_#{bi1.id}") do find("div.ballot").hover - expect(page).to_not have_content('You have already assigned the available budget') + expect(page).not_to have_content('You have already assigned the available budget') expect(page).to have_selector('.in-favor a', visible: true) end @@ -587,7 +587,7 @@ feature 'Ballots' do within("#budget_investment_#{bi2.id}") do find("div.ballot").hover - expect(page).to_not have_content('You have already assigned the available budget') + expect(page).not_to have_content('You have already assigned the available budget') expect(page).to have_selector('.in-favor a', visible: true) end end @@ -612,11 +612,11 @@ feature 'Ballots' do find('.remove-investment-project').trigger('click') end - expect(page).to_not have_css "#budget_investment_#{bi1.id}_sidebar" + expect(page).not_to have_css "#budget_investment_#{bi1.id}_sidebar" within("#budget_investment_#{bi2.id}") do find("div.ballot").hover - expect(page).to_not have_content('You have already assigned the available budget') + expect(page).not_to have_content('You have already assigned the available budget') expect(page).to have_selector('.in-favor a', visible: true) end end @@ -636,7 +636,7 @@ feature 'Ballots' do find('.add a').trigger('click') expect(page.status_code).to eq(200) - expect(page).to_not have_content "Remove" + expect(page).not_to have_content "Remove" expect(page).to have_selector('.participation-not-allowed', visible: false) find("div.ballot").hover expect(page).to have_selector('.participation-not-allowed', visible: true) @@ -653,7 +653,7 @@ feature 'Ballots' do visit budget_investments_path(budget, heading_id: california.id) within("#budget_investment_#{bi1.id}") do - expect(page).to_not have_css("div.ballot") + expect(page).not_to have_css("div.ballot") end end end diff --git a/spec/features/budgets/budgets_spec.rb b/spec/features/budgets/budgets_spec.rb index 81530a43d..f7d194524 100644 --- a/spec/features/budgets/budgets_spec.rb +++ b/spec/features/budgets/budgets_spec.rb @@ -26,13 +26,13 @@ feature 'Budgets' do visit budget_path(budget) - expect(page).to_not have_link "See unfeasible investments" - expect(page).to_not have_link "See investments not selected for balloting phase" + expect(page).not_to have_link "See unfeasible investments" + expect(page).not_to have_link "See investments not selected for balloting phase" click_link group.name - expect(page).to_not have_link "See unfeasible investments" - expect(page).to_not have_link "See investments not selected for balloting phase" + expect(page).not_to have_link "See unfeasible investments" + expect(page).not_to have_link "See investments not selected for balloting phase" budget.update(phase: :balloting) diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb index a967a27f4..62fbeb725 100644 --- a/spec/features/budgets/investments_spec.rb +++ b/spec/features/budgets/investments_spec.rb @@ -37,7 +37,7 @@ feature 'Budget Investments' do within('#budget-investments') do expect(page).to have_content investment.title expect(page).to have_css("a[href='#{budget_investment_path(budget_id: budget.id, id: investment.id)}']", text: investment.title) - expect(page).to_not have_content(unfeasible_investment.title) + expect(page).not_to have_content(unfeasible_investment.title) end end end @@ -50,7 +50,7 @@ feature 'Budget Investments' do visit budget_investments_path(budget, heading_id: heading.id) within("#budget_investment_#{investment.id}") do - expect(page).to_not have_css("div.with-image") + expect(page).not_to have_css("div.with-image") end within("#budget_investment_#{investment_with_image.id}") do expect(page).to have_css("img[alt='#{investment_with_image.image.title}']") @@ -76,7 +76,7 @@ feature 'Budget Investments' do expect(page).to have_content(investment1.title) expect(page).to have_content(investment2.title) - expect(page).to_not have_content(investment3.title) + expect(page).not_to have_content(investment3.title) end end @@ -96,9 +96,9 @@ feature 'Budget Investments' do expect(page).to have_css('.budget-investment', count: 1) expect(page).to have_content(investment1.title) - expect(page).to_not have_content(investment2.title) - expect(page).to_not have_content(investment3.title) - expect(page).to_not have_content(investment4.title) + expect(page).not_to have_content(investment2.title) + expect(page).not_to have_content(investment3.title) + expect(page).not_to have_content(investment4.title) end end @@ -147,7 +147,7 @@ feature 'Budget Investments' do visit budget_investments_path(budget, heading_id: heading.id) new_order = eq(all(".budget-investment h3").collect {|i| i.text }) - expect(order).to_not eq(new_order) + expect(order).not_to eq(new_order) end scenario "Random order after another order" do @@ -163,7 +163,7 @@ feature 'Budget Investments' do visit budget_investments_path(budget, heading_id: heading.id) new_order = eq(all(".budget-investment h3").collect {|i| i.text }) - expect(order).to_not eq(new_order) + expect(order).not_to eq(new_order) end scenario 'Random order maintained with pagination', :js do @@ -370,7 +370,7 @@ feature 'Budget Investments' do fill_in "budget_investment_title", with: "item" within('div#js-suggest') do - expect(page).to_not have_content 'You are seeing' + expect(page).not_to have_content 'You are seeing' end end @@ -385,7 +385,7 @@ feature 'Budget Investments' do fill_in "budget_investment_title", with: "search" within('div#js-suggest') do - expect(page).to_not have_content 'You are seeing' + expect(page).not_to have_content 'You are seeing' end end end @@ -395,10 +395,10 @@ feature 'Budget Investments' do visit budget_investments_path(budget, heading_id: heading.id) - expect(page).to_not have_link('Check my ballot') - expect(page).to_not have_css('#progress_bar') + expect(page).not_to have_link('Check my ballot') + expect(page).not_to have_css('#progress_bar') within('#sidebar') do - expect(page).to_not have_content('My ballot') + expect(page).not_to have_content('My ballot') end end end @@ -474,9 +474,9 @@ feature 'Budget Investments' do budget.update(phase: "selecting") visit budget_investment_path(budget_id: budget.id, id: investment.id) - expect(page).to_not have_content("Unfeasibility explanation") - expect(page).to_not have_content("Price explanation") - expect(page).to_not have_content(investment.price_explanation) + expect(page).not_to have_content("Unfeasibility explanation") + expect(page).not_to have_content("Price explanation") + expect(page).not_to have_content(investment.price_explanation) end scenario "Budget in balloting phase" do @@ -582,7 +582,7 @@ feature 'Budget Investments' do visit user_path(user) within("#budget_investment_#{investment.id}") do - expect(page).to_not have_link "Delete" + expect(page).not_to have_link "Delete" end end @@ -637,7 +637,7 @@ feature 'Budget Investments' do visit budget_investments_path(budget, heading_id: carabanchel.id) within("#budget_investment_#{carabanchel_investment.id}") do - expect(page).to_not have_css(".in-favor a[data-confirm]") + expect(page).not_to have_css(".in-favor a[data-confirm]") end end @@ -830,8 +830,8 @@ feature 'Budget Investments' do expect(page).to have_content sp2.title expect(page).to have_content sp2.price - expect(page).to_not have_content sp3.title - expect(page).to_not have_content sp3.price + expect(page).not_to have_content sp3.title + expect(page).not_to have_content sp3.price end within("#budget_group_#{group.id}") do @@ -841,8 +841,8 @@ feature 'Budget Investments' do expect(page).to have_content sp5.title expect(page).to have_content "€10,000" - expect(page).to_not have_content sp6.title - expect(page).to_not have_content "€100,000" + expect(page).not_to have_content sp6.title + expect(page).not_to have_content "€100,000" end end @@ -870,9 +870,9 @@ feature 'Budget Investments' do expect(page).to have_css('.budget-investment', count: 1) expect(page).to have_content(investment1.title) - expect(page).to_not have_content(investment2.title) - expect(page).to_not have_content(investment3.title) - expect(page).to_not have_content(investment4.title) + expect(page).not_to have_content(investment2.title) + expect(page).not_to have_content(investment3.title) + expect(page).not_to have_content(investment4.title) end end @@ -911,7 +911,7 @@ feature 'Budget Investments' do visit budget_investments_path(budget_id: budget.id, heading_id: heading.id, filter: "unselected") expect(page).to have_content investment.title - expect(page).to_not have_link("Vote") + expect(page).not_to have_link("Vote") end scenario "Do not display vote button for unselected investments in show" do @@ -920,7 +920,7 @@ feature 'Budget Investments' do visit budget_investment_path(budget, investment) expect(page).to have_content investment.title - expect(page).to_not have_link("Vote") + expect(page).not_to have_link("Vote") end feature "Reclassification" do diff --git a/spec/features/budgets/results_spec.rb b/spec/features/budgets/results_spec.rb index 224566f20..178f3007a 100644 --- a/spec/features/budgets/results_spec.rb +++ b/spec/features/budgets/results_spec.rb @@ -60,7 +60,7 @@ feature 'Results' do within("#budget-investments-compatible") do expect(page).to have_content investment1.title - expect(page).to_not have_content other_investment.title + expect(page).not_to have_content other_investment.title end end diff --git a/spec/features/budgets/votes_spec.rb b/spec/features/budgets/votes_spec.rb index 95f040bb3..b8ae564e8 100644 --- a/spec/features/budgets/votes_spec.rb +++ b/spec/features/budgets/votes_spec.rb @@ -30,11 +30,11 @@ feature 'Votes' do end within("#budget_investment_#{investment2.id}_votes") do - expect(page).to_not have_content "You have already supported this. Share it!" + expect(page).not_to have_content "You have already supported this. Share it!" end within("#budget_investment_#{investment3.id}_votes") do - expect(page).to_not have_content "You have already supported this. Share it!" + expect(page).not_to have_content "You have already supported this. Share it!" end end end @@ -70,7 +70,7 @@ feature 'Votes' do find('.in-favor a').click expect(page).to have_content "1 support" - expect(page).to_not have_selector ".in-favor a" + expect(page).not_to have_selector ".in-favor a" end end @@ -94,13 +94,13 @@ feature 'Votes' do visit budget_investments_path(budget, heading_id: heading.id) within("#budget_investment_#{investment.id}") do - expect(page).to_not have_css("budget_investment_#{investment.id}_votes") + expect(page).not_to have_css("budget_investment_#{investment.id}_votes") end visit budget_investment_path(budget, investment) within("#budget_investment_#{investment.id}") do - expect(page).to_not have_css("budget_investment_#{investment.id}_votes") + expect(page).not_to have_css("budget_investment_#{investment.id}_votes") end end end diff --git a/spec/features/campaigns_spec.rb b/spec/features/campaigns_spec.rb index 6e9897a6f..9a8935fc1 100644 --- a/spec/features/campaigns_spec.rb +++ b/spec/features/campaigns_spec.rb @@ -27,7 +27,7 @@ feature 'Email campaigns' do visit admin_stats_path expect(page).to have_content "#{@campaign1.name} (1)" - expect(page).to_not have_content @campaign2.name.to_s + expect(page).not_to have_content @campaign2.name.to_s end end \ No newline at end of file diff --git a/spec/features/comments/budget_investments_spec.rb b/spec/features/comments/budget_investments_spec.rb index ae8fc935a..4afb1e680 100644 --- a/spec/features/comments/budget_investments_spec.rb +++ b/spec/features/comments/budget_investments_spec.rb @@ -51,7 +51,7 @@ feature 'Commenting Budget::Investments' do find("#comment_#{child_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 2) - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content grandchild_comment.body find("#comment_#{child_comment.id}_children_arrow").trigger('click') @@ -61,8 +61,8 @@ feature 'Commenting Budget::Investments' do find("#comment_#{parent_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 1) - expect(page).to_not have_content child_comment.body - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content child_comment.body + expect(page).not_to have_content grandchild_comment.body end scenario 'Comment order' do @@ -147,7 +147,7 @@ feature 'Commenting Budget::Investments' do within("ul.pagination") do expect(page).to have_content("1") expect(page).to have_content("2") - expect(page).to_not have_content("3") + expect(page).not_to have_content("3") click_link "Next", exact: false end @@ -161,8 +161,8 @@ feature 'Commenting Budget::Investments' do expect(page).to have_content 'You must Sign in or Sign up to leave a comment' within('#comments') do - expect(page).to_not have_content 'Write a comment' - expect(page).to_not have_content 'Reply' + expect(page).not_to have_content 'Write a comment' + expect(page).not_to have_content 'Reply' end end end @@ -211,7 +211,7 @@ feature 'Commenting Budget::Investments' do expect(page).to have_content 'It will be done next week.' end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario 'Errors on reply', :js do @@ -271,7 +271,7 @@ feature 'Commenting Budget::Investments' do expect(page).to have_css("#flag-expand-comment-#{comment.id}") end - expect(Flag.flagged?(user, comment)).to_not be + expect(Flag.flagged?(user, comment)).not_to be end scenario "Flagging turbolinks sanity check", :js do @@ -343,7 +343,7 @@ feature 'Commenting Budget::Investments' do expect(page).to have_css "img.moderator-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as an administrator" do @@ -352,7 +352,7 @@ feature 'Commenting Budget::Investments' do login_as(moderator.user) visit budget_investment_path(investment.budget, investment) - expect(page).to_not have_content "Comment as administrator" + expect(page).not_to have_content "Comment as administrator" end end @@ -399,7 +399,7 @@ feature 'Commenting Budget::Investments' do expect(page).to have_css "img.admin-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as a moderator" do @@ -408,7 +408,7 @@ feature 'Commenting Budget::Investments' do login_as(admin.user) visit budget_investment_path(investment.budget, investment) - expect(page).to_not have_content "Comment as moderator" + expect(page).not_to have_content "Comment as moderator" end end diff --git a/spec/features/comments/debates_spec.rb b/spec/features/comments/debates_spec.rb index 77cab01d9..22a719526 100644 --- a/spec/features/comments/debates_spec.rb +++ b/spec/features/comments/debates_spec.rb @@ -51,7 +51,7 @@ feature 'Commenting debates' do find("#comment_#{child_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 2) - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content grandchild_comment.body find("#comment_#{child_comment.id}_children_arrow").trigger('click') @@ -61,8 +61,8 @@ feature 'Commenting debates' do find("#comment_#{parent_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 1) - expect(page).to_not have_content child_comment.body - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content child_comment.body + expect(page).not_to have_content grandchild_comment.body end scenario 'Comment order' do @@ -147,7 +147,7 @@ feature 'Commenting debates' do within("ul.pagination") do expect(page).to have_content("1") expect(page).to have_content("2") - expect(page).to_not have_content("3") + expect(page).not_to have_content("3") click_link "Next", exact: false end @@ -161,8 +161,8 @@ feature 'Commenting debates' do expect(page).to have_content 'You must Sign in or Sign up to leave a comment' within('#comments') do - expect(page).to_not have_content 'Write a comment' - expect(page).to_not have_content 'Reply' + expect(page).not_to have_content 'Write a comment' + expect(page).not_to have_content 'Reply' end end end @@ -208,7 +208,7 @@ feature 'Commenting debates' do expect(page).to have_content 'It will be done next week.' end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario 'Errors on reply', :js do @@ -268,7 +268,7 @@ feature 'Commenting debates' do expect(page).to have_css("#flag-expand-comment-#{comment.id}") end - expect(Flag.flagged?(user, comment)).to_not be + expect(Flag.flagged?(user, comment)).not_to be end scenario "Flagging turbolinks sanity check", :js do @@ -307,7 +307,7 @@ feature 'Commenting debates' do # The button's text should now be "..." # This should be checked before the Ajax request is finished - expect(page).to_not have_button 'Publish comment' + expect(page).not_to have_button 'Publish comment' expect(page).to have_content('Testing submit button!') end @@ -355,7 +355,7 @@ feature 'Commenting debates' do expect(page).to have_css "img.moderator-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as an administrator" do @@ -364,7 +364,7 @@ feature 'Commenting debates' do login_as(moderator.user) visit debate_path(debate) - expect(page).to_not have_content "Comment as administrator" + expect(page).not_to have_content "Comment as administrator" end end @@ -411,7 +411,7 @@ feature 'Commenting debates' do expect(page).to have_css "img.admin-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as a moderator" do @@ -420,7 +420,7 @@ feature 'Commenting debates' do login_as(admin.user) visit debate_path(debate) - expect(page).to_not have_content "Comment as moderator" + expect(page).not_to have_content "Comment as moderator" end end @@ -501,7 +501,7 @@ feature 'Commenting debates' do find('.in_favor a').click within('.in_favor') do - expect(page).to_not have_content "2" + expect(page).not_to have_content "2" expect(page).to have_content "1" end diff --git a/spec/features/comments/legislation_annotations_spec.rb b/spec/features/comments/legislation_annotations_spec.rb index aad2b90b2..96161c377 100644 --- a/spec/features/comments/legislation_annotations_spec.rb +++ b/spec/features/comments/legislation_annotations_spec.rb @@ -58,7 +58,7 @@ feature 'Commenting legislation questions' do find("#comment_#{child_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 2) - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content grandchild_comment.body find("#comment_#{child_comment.id}_children_arrow").trigger('click') @@ -68,8 +68,8 @@ feature 'Commenting legislation questions' do find("#comment_#{parent_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 1) - expect(page).to_not have_content child_comment.body - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content child_comment.body + expect(page).not_to have_content grandchild_comment.body end scenario 'Comment order' do @@ -178,7 +178,7 @@ feature 'Commenting legislation questions' do within("ul.pagination") do expect(page).to have_content("1") expect(page).to have_content("2") - expect(page).to_not have_content("3") + expect(page).not_to have_content("3") click_link "Next", exact: false end @@ -194,8 +194,8 @@ feature 'Commenting legislation questions' do expect(page).to have_content 'You must Sign in or Sign up to leave a comment' within('#comments') do - expect(page).to_not have_content 'Write a comment' - expect(page).to_not have_content 'Reply' + expect(page).not_to have_content 'Write a comment' + expect(page).not_to have_content 'Reply' end end end @@ -248,7 +248,7 @@ feature 'Commenting legislation questions' do expect(page).to have_content 'It will be done next week.' end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario 'Errors on reply', :js do @@ -317,7 +317,7 @@ feature 'Commenting legislation questions' do expect(page).to have_css("#flag-expand-comment-#{comment.id}") end - expect(Flag.flagged?(user, comment)).to_not be + expect(Flag.flagged?(user, comment)).not_to be end scenario "Flagging turbolinks sanity check", :js do @@ -363,7 +363,7 @@ feature 'Commenting legislation questions' do # The button's text should now be "..." # This should be checked before the Ajax request is finished - expect(page).to_not have_button 'Publish comment' + expect(page).not_to have_button 'Publish comment' expect(page).to have_content('Testing submit button!') end @@ -416,7 +416,7 @@ feature 'Commenting legislation questions' do expect(page).to have_css "img.moderator-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as an administrator" do @@ -427,7 +427,7 @@ feature 'Commenting legislation questions' do legislation_annotation.draft_version, legislation_annotation) - expect(page).to_not have_content "Comment as administrator" + expect(page).not_to have_content "Comment as administrator" end end @@ -479,7 +479,7 @@ feature 'Commenting legislation questions' do expect(page).to have_css "img.admin-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as a moderator" do @@ -490,7 +490,7 @@ feature 'Commenting legislation questions' do legislation_annotation.draft_version, legislation_annotation) - expect(page).to_not have_content "Comment as moderator" + expect(page).not_to have_content "Comment as moderator" end end @@ -579,7 +579,7 @@ feature 'Commenting legislation questions' do find('.in_favor a').click within('.in_favor') do - expect(page).to_not have_content "2" + expect(page).not_to have_content "2" expect(page).to have_content "1" end diff --git a/spec/features/comments/legislation_questions_spec.rb b/spec/features/comments/legislation_questions_spec.rb index b41a9bf47..d0e341498 100644 --- a/spec/features/comments/legislation_questions_spec.rb +++ b/spec/features/comments/legislation_questions_spec.rb @@ -58,7 +58,7 @@ feature 'Commenting legislation questions' do find("#comment_#{child_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 2) - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content grandchild_comment.body find("#comment_#{child_comment.id}_children_arrow").trigger('click') @@ -68,8 +68,8 @@ feature 'Commenting legislation questions' do find("#comment_#{parent_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 1) - expect(page).to_not have_content child_comment.body - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content child_comment.body + expect(page).not_to have_content grandchild_comment.body end scenario 'Comment order' do @@ -154,7 +154,7 @@ feature 'Commenting legislation questions' do within("ul.pagination") do expect(page).to have_content("1") expect(page).to have_content("2") - expect(page).to_not have_content("3") + expect(page).not_to have_content("3") click_link "Next", exact: false end @@ -168,8 +168,8 @@ feature 'Commenting legislation questions' do expect(page).to have_content 'You must Sign in or Sign up to leave a comment' within('#comments') do - expect(page).to_not have_content 'Write a comment' - expect(page).to_not have_content 'Reply' + expect(page).not_to have_content 'Write a comment' + expect(page).not_to have_content 'Reply' end end end @@ -233,7 +233,7 @@ feature 'Commenting legislation questions' do expect(page).to have_content 'It will be done next week.' end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario 'Errors on reply', :js do @@ -293,7 +293,7 @@ feature 'Commenting legislation questions' do expect(page).to have_css("#flag-expand-comment-#{comment.id}") end - expect(Flag.flagged?(user, comment)).to_not be + expect(Flag.flagged?(user, comment)).not_to be end scenario "Flagging turbolinks sanity check", :js do @@ -330,7 +330,7 @@ feature 'Commenting legislation questions' do # The button's text should now be "..." # This should be checked before the Ajax request is finished - expect(page).to_not have_button 'Publish answer' + expect(page).not_to have_button 'Publish answer' expect(page).to have_content('Testing submit button!') end @@ -378,7 +378,7 @@ feature 'Commenting legislation questions' do expect(page).to have_css "img.moderator-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as an administrator" do @@ -387,7 +387,7 @@ feature 'Commenting legislation questions' do login_as(moderator.user) visit legislation_process_question_path(legislation_question.process, legislation_question) - expect(page).to_not have_content "Comment as administrator" + expect(page).not_to have_content "Comment as administrator" end end @@ -434,7 +434,7 @@ feature 'Commenting legislation questions' do expect(page).to have_css "img.admin-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as a moderator" do @@ -443,7 +443,7 @@ feature 'Commenting legislation questions' do login_as(admin.user) visit legislation_process_question_path(legislation_question.process, legislation_question) - expect(page).to_not have_content "Comment as moderator" + expect(page).not_to have_content "Comment as moderator" end end @@ -524,7 +524,7 @@ feature 'Commenting legislation questions' do find('.in_favor a').click within('.in_favor') do - expect(page).to_not have_content "2" + expect(page).not_to have_content "2" expect(page).to have_content "1" end diff --git a/spec/features/comments/polls_spec.rb b/spec/features/comments/polls_spec.rb index 05df65ad0..1a371e9cc 100644 --- a/spec/features/comments/polls_spec.rb +++ b/spec/features/comments/polls_spec.rb @@ -52,7 +52,7 @@ feature 'Commenting polls' do find("#comment_#{child_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 2) - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content grandchild_comment.body find("#comment_#{child_comment.id}_children_arrow").trigger('click') @@ -62,8 +62,8 @@ feature 'Commenting polls' do find("#comment_#{parent_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 1) - expect(page).to_not have_content child_comment.body - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content child_comment.body + expect(page).not_to have_content grandchild_comment.body end scenario 'Comment order' do @@ -148,7 +148,7 @@ feature 'Commenting polls' do within("ul.pagination") do expect(page).to have_content("1") expect(page).to have_content("2") - expect(page).to_not have_content("3") + expect(page).not_to have_content("3") click_link "Next", exact: false end @@ -162,8 +162,8 @@ feature 'Commenting polls' do expect(page).to have_content 'You must Sign in or Sign up to leave a comment' within('#comments') do - expect(page).to_not have_content 'Write a comment' - expect(page).to_not have_content 'Reply' + expect(page).not_to have_content 'Write a comment' + expect(page).not_to have_content 'Reply' end end end @@ -212,7 +212,7 @@ feature 'Commenting polls' do expect(page).to have_content 'It will be done next week.' end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario 'Errors on reply', :js do @@ -276,7 +276,7 @@ feature 'Commenting polls' do expect(page).to have_css("#flag-expand-comment-#{comment.id}") end - expect(Flag.flagged?(user, comment)).to_not be + expect(Flag.flagged?(user, comment)).not_to be end scenario "Flagging turbolinks sanity check", :js do @@ -355,7 +355,7 @@ feature 'Commenting polls' do expect(page).to have_css "img.moderator-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as an administrator" do @@ -366,7 +366,7 @@ feature 'Commenting polls' do login_as(moderator.user) visit poll_path(poll) - expect(page).to_not have_content "Comment as administrator" + expect(page).not_to have_content "Comment as administrator" end end @@ -417,7 +417,7 @@ feature 'Commenting polls' do expect(page).to have_css "img.admin-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as a moderator" do @@ -428,7 +428,7 @@ feature 'Commenting polls' do login_as(admin.user) visit poll_path(poll) - expect(page).to_not have_content "Comment as moderator" + expect(page).not_to have_content "Comment as moderator" end end diff --git a/spec/features/comments/proposals_spec.rb b/spec/features/comments/proposals_spec.rb index acba0bec9..959b4b65b 100644 --- a/spec/features/comments/proposals_spec.rb +++ b/spec/features/comments/proposals_spec.rb @@ -50,7 +50,7 @@ feature 'Commenting proposals' do find("#comment_#{child_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 2) - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content grandchild_comment.body find("#comment_#{child_comment.id}_children_arrow").trigger('click') @@ -60,8 +60,8 @@ feature 'Commenting proposals' do find("#comment_#{parent_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 1) - expect(page).to_not have_content child_comment.body - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content child_comment.body + expect(page).not_to have_content grandchild_comment.body end scenario 'Comment order' do @@ -146,7 +146,7 @@ feature 'Commenting proposals' do within("ul.pagination") do expect(page).to have_content("1") expect(page).to have_content("2") - expect(page).to_not have_content("3") + expect(page).not_to have_content("3") click_link "Next", exact: false end @@ -160,8 +160,8 @@ feature 'Commenting proposals' do expect(page).to have_content 'You must Sign in or Sign up to leave a comment' within('#comments') do - expect(page).to_not have_content 'Write a comment' - expect(page).to_not have_content 'Reply' + expect(page).not_to have_content 'Write a comment' + expect(page).not_to have_content 'Reply' end end end @@ -210,7 +210,7 @@ feature 'Commenting proposals' do expect(page).to have_content 'It will be done next week.' end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario 'Errors on reply', :js do @@ -270,7 +270,7 @@ feature 'Commenting proposals' do expect(page).to have_css("#flag-expand-comment-#{comment.id}") end - expect(Flag.flagged?(user, comment)).to_not be + expect(Flag.flagged?(user, comment)).not_to be end scenario "Flagging turbolinks sanity check", :js do @@ -342,7 +342,7 @@ feature 'Commenting proposals' do expect(page).to have_css "img.moderator-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as an administrator" do @@ -351,7 +351,7 @@ feature 'Commenting proposals' do login_as(moderator.user) visit proposal_path(proposal) - expect(page).to_not have_content "Comment as administrator" + expect(page).not_to have_content "Comment as administrator" end end @@ -398,7 +398,7 @@ feature 'Commenting proposals' do expect(page).to have_css "img.admin-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as a moderator" do @@ -407,7 +407,7 @@ feature 'Commenting proposals' do login_as(admin.user) visit proposal_path(proposal) - expect(page).to_not have_content "Comment as moderator" + expect(page).not_to have_content "Comment as moderator" end end diff --git a/spec/features/comments/topics_spec.rb b/spec/features/comments/topics_spec.rb index 38971fcff..2d09b5ff4 100644 --- a/spec/features/comments/topics_spec.rb +++ b/spec/features/comments/topics_spec.rb @@ -54,7 +54,7 @@ feature 'Commenting topics from proposals' do find("#comment_#{child_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 2) - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content grandchild_comment.body find("#comment_#{child_comment.id}_children_arrow").trigger('click') @@ -64,8 +64,8 @@ feature 'Commenting topics from proposals' do find("#comment_#{parent_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 1) - expect(page).to_not have_content child_comment.body - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content child_comment.body + expect(page).not_to have_content grandchild_comment.body end scenario 'Comment order' do @@ -160,7 +160,7 @@ feature 'Commenting topics from proposals' do within("ul.pagination") do expect(page).to have_content("1") expect(page).to have_content("2") - expect(page).to_not have_content("3") + expect(page).not_to have_content("3") click_link "Next", exact: false end @@ -177,8 +177,8 @@ feature 'Commenting topics from proposals' do expect(page).to have_content 'You must Sign in or Sign up to leave a comment' within('#comments') do - expect(page).to_not have_content 'Write a comment' - expect(page).to_not have_content 'Reply' + expect(page).not_to have_content 'Write a comment' + expect(page).not_to have_content 'Reply' end end end @@ -233,7 +233,7 @@ feature 'Commenting topics from proposals' do expect(page).to have_content 'It will be done next week.' end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario 'Errors on reply', :js do @@ -301,7 +301,7 @@ feature 'Commenting topics from proposals' do expect(page).to have_css("#flag-expand-comment-#{comment.id}") end - expect(Flag.flagged?(user, comment)).to_not be + expect(Flag.flagged?(user, comment)).not_to be end scenario "Flagging turbolinks sanity check", :js do @@ -384,7 +384,7 @@ feature 'Commenting topics from proposals' do expect(page).to have_css "img.moderator-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as an administrator" do @@ -395,7 +395,7 @@ feature 'Commenting topics from proposals' do login_as(moderator.user) visit community_topic_path(community, topic) - expect(page).to_not have_content "Comment as administrator" + expect(page).not_to have_content "Comment as administrator" end end @@ -446,7 +446,7 @@ feature 'Commenting topics from proposals' do expect(page).to have_css "img.admin-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as a moderator" do @@ -457,7 +457,7 @@ feature 'Commenting topics from proposals' do login_as(admin.user) visit community_topic_path(community, topic) - expect(page).to_not have_content "Comment as moderator" + expect(page).not_to have_content "Comment as moderator" end end @@ -604,7 +604,7 @@ feature 'Commenting topics from budget investments' do find("#comment_#{child_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 2) - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content grandchild_comment.body find("#comment_#{child_comment.id}_children_arrow").trigger('click') @@ -614,8 +614,8 @@ feature 'Commenting topics from budget investments' do find("#comment_#{parent_comment.id}_children_arrow").trigger('click') expect(page).to have_css('.comment', count: 1) - expect(page).to_not have_content child_comment.body - expect(page).to_not have_content grandchild_comment.body + expect(page).not_to have_content child_comment.body + expect(page).not_to have_content grandchild_comment.body end scenario 'Comment order' do @@ -710,7 +710,7 @@ feature 'Commenting topics from budget investments' do within("ul.pagination") do expect(page).to have_content("1") expect(page).to have_content("2") - expect(page).to_not have_content("3") + expect(page).not_to have_content("3") click_link "Next", exact: false end @@ -727,8 +727,8 @@ feature 'Commenting topics from budget investments' do expect(page).to have_content 'You must Sign in or Sign up to leave a comment' within('#comments') do - expect(page).to_not have_content 'Write a comment' - expect(page).to_not have_content 'Reply' + expect(page).not_to have_content 'Write a comment' + expect(page).not_to have_content 'Reply' end end end @@ -783,7 +783,7 @@ feature 'Commenting topics from budget investments' do expect(page).to have_content 'It will be done next week.' end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario 'Errors on reply', :js do @@ -851,7 +851,7 @@ feature 'Commenting topics from budget investments' do expect(page).to have_css("#flag-expand-comment-#{comment.id}") end - expect(Flag.flagged?(user, comment)).to_not be + expect(Flag.flagged?(user, comment)).not_to be end scenario "Flagging turbolinks sanity check", :js do @@ -934,7 +934,7 @@ feature 'Commenting topics from budget investments' do expect(page).to have_css "img.moderator-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as an administrator" do @@ -945,7 +945,7 @@ feature 'Commenting topics from budget investments' do login_as(moderator.user) visit community_topic_path(community, topic) - expect(page).to_not have_content "Comment as administrator" + expect(page).not_to have_content "Comment as administrator" end end @@ -996,7 +996,7 @@ feature 'Commenting topics from budget investments' do expect(page).to have_css "img.admin-avatar" end - expect(page).to_not have_selector("#js-comment-form-comment_#{comment.id}", visible: true) + expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true) end scenario "can not comment as a moderator" do @@ -1007,7 +1007,7 @@ feature 'Commenting topics from budget investments' do login_as(admin.user) visit community_topic_path(community, topic) - expect(page).to_not have_content "Comment as moderator" + expect(page).not_to have_content "Comment as moderator" end end diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 0d5e4b048..d05fc12e5 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -40,7 +40,7 @@ feature 'Debates' do within("ul.pagination") do expect(page).to have_content("1") expect(page).to have_content("2") - expect(page).to_not have_content("3") + expect(page).not_to have_content("3") click_link "Next", exact: false end @@ -172,8 +172,8 @@ feature 'Debates' do expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'Testing an attack' expect(page.html).to include '

This is alert("an attack");

' - expect(page.html).to_not include '' - expect(page.html).to_not include '<p>This is' + expect(page.html).not_to include '' + expect(page.html).not_to include '<p>This is' end scenario 'Autolinking is applied to description' do @@ -208,13 +208,13 @@ feature 'Debates' do expect(page).to have_content 'Testing auto link' expect(page).to have_link('http://example.org', href: 'http://example.org') expect(page).not_to have_link('click me') - expect(page.html).to_not include "" + expect(page.html).not_to include "" click_link 'Edit' expect(page).to have_current_path(edit_debate_path(Debate.last)) expect(page).not_to have_link('click me') - expect(page.html).to_not include "" + expect(page.html).not_to include "" end scenario 'Update should not be posible if logged user is not the author' do @@ -233,7 +233,7 @@ feature 'Debates' do Setting["max_votes_for_debate_edit"] = 2 3.times { create(:vote, votable: debate) } - expect(debate).to_not be_editable + expect(debate).not_to be_editable login_as(debate.author) visit edit_debate_path(debate) @@ -303,7 +303,7 @@ feature 'Debates' do expect(page).to have_css("#flag-expand-debate-#{debate.id}") end - expect(Flag.flagged?(user, debate)).to_not be + expect(Flag.flagged?(user, debate)).not_to be end feature 'Debate index order filters' do @@ -449,7 +449,7 @@ feature 'Debates' do expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) + expect(page).not_to have_content(debate3.title) end end @@ -484,7 +484,7 @@ feature 'Debates' do within("#debates") do expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) + expect(page).not_to have_content(debate3.title) end end @@ -509,7 +509,7 @@ feature 'Debates' do within("#debates") do expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) + expect(page).not_to have_content(debate3.title) end end @@ -532,7 +532,7 @@ feature 'Debates' do within("#debates") do expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) + expect(page).not_to have_content(debate3.title) end end @@ -555,7 +555,7 @@ feature 'Debates' do within("#debates") do expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) + expect(page).not_to have_content(debate3.title) end end @@ -578,7 +578,7 @@ feature 'Debates' do within("#debates") do expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) + expect(page).not_to have_content(debate3.title) end end @@ -601,7 +601,7 @@ feature 'Debates' do within("#debates") do expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) + expect(page).not_to have_content(debate3.title) end end @@ -627,7 +627,7 @@ feature 'Debates' do expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) + expect(page).not_to have_content(debate3.title) end end @@ -647,7 +647,7 @@ feature 'Debates' do expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) + expect(page).not_to have_content(debate3.title) end end @@ -667,7 +667,7 @@ feature 'Debates' do expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) + expect(page).not_to have_content(debate3.title) end end @@ -687,7 +687,7 @@ feature 'Debates' do expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) + expect(page).not_to have_content(debate3.title) end end @@ -711,7 +711,7 @@ feature 'Debates' do expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) + expect(page).not_to have_content(debate3.title) end end @@ -830,7 +830,7 @@ feature 'Debates' do expect(all(".debate")[0].text).to match "Show you got" expect(all(".debate")[1].text).to match "Show you got" expect(all(".debate")[2].text).to match "Show what you got" - expect(page).to_not have_content "Do not display" + expect(page).not_to have_content "Do not display" end end @@ -854,8 +854,8 @@ feature 'Debates' do within("#debates") do expect(all(".debate")[0].text).to match "Show you got" expect(all(".debate")[1].text).to match "Show what you got" - expect(page).to_not have_content "Do not display with same tag" - expect(page).to_not have_content "Do not display" + expect(page).not_to have_content "Do not display with same tag" + expect(page).not_to have_content "Do not display" end Setting['feature.user.recommendations'] = nil end @@ -870,8 +870,8 @@ feature 'Debates' do click_button "Search" end - expect(page).to_not have_selector('#debates .debate-featured') - expect(page).to_not have_selector('#featured-debates') + expect(page).not_to have_selector('#debates .debate-featured') + expect(page).not_to have_selector('#featured-debates') end end @@ -884,7 +884,7 @@ feature 'Debates' do expect(page).to have_content "This debate has been flagged as inappropriate by several users." visit debate_path(good_debate) - expect(page).to_not have_content "This debate has been flagged as inappropriate by several users." + expect(page).not_to have_content "This debate has been flagged as inappropriate by several users." end scenario 'Erased author' do @@ -925,7 +925,7 @@ feature 'Debates' do expect(page).to have_css('.debate', count: 2) expect(page).to have_content(@debate1.title) expect(page).to have_content(@debate2.title) - expect(page).to_not have_content(@debate3.title) + expect(page).not_to have_content(@debate3.title) end end @@ -940,7 +940,7 @@ feature 'Debates' do expect(page).to have_css('.debate', count: 2) expect(page).to have_content(@debate1.title) expect(page).to have_content(@debate2.title) - expect(page).to_not have_content(@debate3.title) + expect(page).not_to have_content(@debate3.title) end end @@ -955,7 +955,7 @@ feature 'Debates' do expect(page).to have_css('.debate', count: 2) expect(page).to have_content(@debate1.title) expect(page).to have_content(@debate2.title) - expect(page).to_not have_content(@debate3.title) + expect(page).not_to have_content(@debate3.title) end end @@ -996,7 +996,7 @@ feature 'Debates' do check "debate_terms_of_service" within('div#js-suggest') do - expect(page).to_not have_content 'You are seeing' + expect(page).not_to have_content 'You are seeing' end end end @@ -1009,7 +1009,7 @@ feature 'Debates' do visit debates_path within('#debates') do - expect(page).to_not have_content 'Featured' + expect(page).not_to have_content 'Featured' end click_link debate.title @@ -1030,7 +1030,7 @@ feature 'Debates' do click_link 'Unmark featured' within('#debates') do - expect(page).to_not have_content 'Featured' + expect(page).not_to have_content 'Featured' end end @@ -1056,7 +1056,7 @@ feature 'Debates' do visit debates_path within('#debates') do - expect(page).to_not have_content("Featured") + expect(page).not_to have_content("Featured") end end diff --git a/spec/features/direct_messages_spec.rb b/spec/features/direct_messages_spec.rb index 3c822de5c..d2ebccd87 100644 --- a/spec/features/direct_messages_spec.rb +++ b/spec/features/direct_messages_spec.rb @@ -34,7 +34,7 @@ feature 'Direct messages' do login_as(sender) visit user_path(sender) - expect(page).to_not have_link "Send private message" + expect(page).not_to have_link "Send private message" end scenario "Do not display link if direct message for user not allowed" do @@ -45,7 +45,7 @@ feature 'Direct messages' do visit user_path(receiver) expect(page).to have_content "This user doesn't accept private messages." - expect(page).to_not have_link "Send private message" + expect(page).not_to have_link "Send private message" end scenario "Unverified user" do @@ -56,7 +56,7 @@ feature 'Direct messages' do visit new_user_direct_message_path(receiver) expect(page).to have_content "To send a private message verify your account" - expect(page).to_not have_link "Send private message" + expect(page).not_to have_link "Send private message" end scenario "User not logged in" do @@ -66,7 +66,7 @@ feature 'Direct messages' do visit new_user_direct_message_path(receiver) expect(page).to have_content "You must sign in or sign up to continue." - expect(page).to_not have_link "Send private message" + expect(page).not_to have_link "Send private message" end scenario "Accessing form directly" do @@ -77,7 +77,7 @@ feature 'Direct messages' do visit new_user_direct_message_path(receiver) expect(page).to have_content("This user has decided not to receive direct messages") - expect(page).to_not have_css("#direct_message_title") + expect(page).not_to have_css("#direct_message_title") end end @@ -114,7 +114,7 @@ feature 'Direct messages' do click_button "Send message" expect(page).to have_content "You have reached the maximum number of private messages per day" - expect(page).to_not have_content "You message has been sent successfully." + expect(page).not_to have_content "You message has been sent successfully." end end diff --git a/spec/features/emails_spec.rb b/spec/features/emails_spec.rb index 1792f1058..4c73c74e3 100644 --- a/spec/features/emails_spec.rb +++ b/spec/features/emails_spec.rb @@ -189,7 +189,7 @@ feature 'Emails' do email = open_last_email expect(email).to have_subject('Someone has responded to your comment') expect(email).to deliver_to(user) - expect(email).to_not have_body_text(debate_path(Comment.first.commentable)) + expect(email).not_to have_body_text(debate_path(Comment.first.commentable)) expect(email).to have_body_text(comment_path(Comment.last)) expect(email).to have_body_text(I18n.t("mailers.config.manage_email_subscriptions")) expect(email).to have_body_text(account_path) @@ -327,7 +327,7 @@ feature 'Emails' do expect(email).to have_body_text(/#{proposal_path(proposal2, anchor: 'social-share')}/) expect(email).to have_body_text(proposal2.author.name) - expect(email).to_not have_body_text(proposal3.title) + expect(email).not_to have_body_text(proposal3.title) expect(email).to have_body_text(/#{account_path}/) notification1.reload @@ -434,7 +434,7 @@ feature 'Emails' do expect(find_email(investment1.author.email)).to be expect(find_email(investment2.author.email)).to be - expect(find_email(investment3.author.email)).to_not be + expect(find_email(investment3.author.email)).not_to be email = open_last_email investment = investment2 @@ -457,7 +457,7 @@ feature 'Emails' do expect(find_email(investment1.author.email)).to be expect(find_email(investment2.author.email)).to be - expect(find_email(investment3.author.email)).to_not be + expect(find_email(investment3.author.email)).not_to be email = open_last_email investment = investment2 @@ -493,7 +493,7 @@ feature 'Emails' do email = open_last_email expect(email).to have_subject('Someone has responded to your comment') expect(email).to deliver_to(user1) - expect(email).to_not have_body_text(poll_path(poll)) + expect(email).not_to have_body_text(poll_path(poll)) expect(email).to have_body_text(comment_path(Comment.last)) expect(email).to have_body_text(I18n.t("mailers.config.manage_email_subscriptions")) expect(email).to have_body_text(account_path) diff --git a/spec/features/legislation/draft_versions_spec.rb b/spec/features/legislation/draft_versions_spec.rb index dcc3705f2..2effaa5d0 100644 --- a/spec/features/legislation/draft_versions_spec.rb +++ b/spec/features/legislation/draft_versions_spec.rb @@ -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" diff --git a/spec/features/legislation/processes_spec.rb b/spec/features/legislation/processes_spec.rb index 4206657a9..79565d110 100644 --- a/spec/features/legislation/processes_spec.rb +++ b/spec/features/legislation/processes_spec.rb @@ -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 diff --git a/spec/features/legislation/questions_spec.rb b/spec/features/legislation/questions_spec.rb index 2790481ea..42e731fbf 100644 --- a/spec/features/legislation/questions_spec.rb +++ b/spec/features/legislation/questions_spec.rb @@ -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 diff --git a/spec/features/localization_spec.rb b/spec/features/localization_spec.rb index d9470c653..5c6098481 100644 --- a/spec/features/localization_spec.rb +++ b/spec/features/localization_spec.rb @@ -29,7 +29,7 @@ feature 'Localization' do select('Español', from: 'locale-switcher') expect(page).to have_content('Idioma') - expect(page).to_not have_content('Language') + expect(page).not_to have_content('Language') expect(page).to have_select('locale-switcher', selected: 'Español') end @@ -37,7 +37,7 @@ feature 'Localization' do allow(I18n).to receive(:available_locales).and_return([:en]) visit '/' - expect(page).to_not have_content('Language') - expect(page).to_not have_css('div.locale') + expect(page).not_to have_content('Language') + expect(page).not_to have_css('div.locale') end end diff --git a/spec/features/management/budget_investments_spec.rb b/spec/features/management/budget_investments_spec.rb index 714f32132..27aa25f8d 100644 --- a/spec/features/management/budget_investments_spec.rb +++ b/spec/features/management/budget_investments_spec.rb @@ -83,7 +83,7 @@ feature 'Budget Investments' do within("#budget-investments") do expect(page).to have_css('.budget-investment', count: 1) expect(page).to have_content(budget_investment1.title) - expect(page).to_not have_content(budget_investment2.title) + expect(page).not_to have_content(budget_investment2.title) expect(page).to have_css("a[href='#{management_budget_investment_path(@budget, budget_investment1)}']", text: budget_investment1.title) end @@ -109,7 +109,7 @@ feature 'Budget Investments' do within("#budget-investments") do expect(page).to have_css('.budget-investment', count: 1) - expect(page).to_not have_content(budget_investment1.title) + expect(page).not_to have_content(budget_investment1.title) expect(page).to have_content(budget_investment2.title) expect(page).to have_css("a[href='#{management_budget_investment_path(@budget, budget_investment2)}']", text: budget_investment2.title) @@ -162,12 +162,12 @@ feature 'Budget Investments' do expect(page).to have_content(accepting_budget.name) - expect(page).to_not have_content(reviewing_budget.name) - expect(page).to_not have_content(selecting_budget.name) - expect(page).to_not have_content(valuating_budget.name) - expect(page).to_not have_content(balloting_budget.name) - expect(page).to_not have_content(reviewing_ballots_budget.name) - expect(page).to_not have_content(finished.name) + expect(page).not_to have_content(reviewing_budget.name) + expect(page).not_to have_content(selecting_budget.name) + expect(page).not_to have_content(valuating_budget.name) + expect(page).not_to have_content(balloting_budget.name) + expect(page).not_to have_content(reviewing_ballots_budget.name) + expect(page).not_to have_content(finished.name) end scenario "Listing - admins can see budgets in accepting, reviewing and selecting phases" do @@ -195,10 +195,10 @@ feature 'Budget Investments' do expect(page).to have_content(reviewing_budget.name) expect(page).to have_content(selecting_budget.name) - expect(page).to_not have_content(valuating_budget.name) - expect(page).to_not have_content(balloting_budget.name) - expect(page).to_not have_content(reviewing_ballots_budget.name) - expect(page).to_not have_content(finished.name) + expect(page).not_to have_content(valuating_budget.name) + expect(page).not_to have_content(balloting_budget.name) + expect(page).not_to have_content(reviewing_ballots_budget.name) + expect(page).not_to have_content(finished.name) end context "Supporting" do @@ -300,7 +300,7 @@ feature 'Budget Investments' do click_button("Search") within '#budget-investments' do - expect(page).to_not have_content(unvoted_investment.title) + expect(page).not_to have_content(unvoted_investment.title) expect(top_investment.title).to appear_before(mid_investment.title) expect(mid_investment.title).to appear_before(low_investment.title) end diff --git a/spec/features/management/email_verifications_spec.rb b/spec/features/management/email_verifications_spec.rb index d68d9bd5f..a5bd4d40e 100644 --- a/spec/features/management/email_verifications_spec.rb +++ b/spec/features/management/email_verifications_spec.rb @@ -27,7 +27,7 @@ feature 'EmailVerifications' do expect(page).to have_content "You are a verified user" - expect(page).to_not have_link "Verify my account" + expect(page).not_to have_link "Verify my account" expect(page).to have_content "Account verified" expect(user.reload.document_number).to eq('12345678Z') diff --git a/spec/features/management/localization_spec.rb b/spec/features/management/localization_spec.rb index 4f00a23dd..dacff366e 100644 --- a/spec/features/management/localization_spec.rb +++ b/spec/features/management/localization_spec.rb @@ -34,7 +34,7 @@ feature 'Localization' do select('Español', from: 'locale-switcher') expect(page).to have_content('Idioma') - expect(page).to_not have_content('Language') + expect(page).not_to have_content('Language') expect(page).to have_select('locale-switcher', selected: 'Español') end @@ -42,7 +42,7 @@ feature 'Localization' do allow(I18n).to receive(:available_locales).and_return([:en]) visit management_root_path - expect(page).to_not have_content('Language') - expect(page).to_not have_css('div.locale') + expect(page).not_to have_content('Language') + expect(page).not_to have_css('div.locale') end end diff --git a/spec/features/management/managed_users_spec.rb b/spec/features/management/managed_users_spec.rb index 13c04b010..3bd429e0f 100644 --- a/spec/features/management/managed_users_spec.rb +++ b/spec/features/management/managed_users_spec.rb @@ -101,7 +101,7 @@ feature 'Managed User' do click_button 'Create user' expect(page).to have_content "We have sent an email" - expect(page).to_not have_content "Autogenerated password is" + expect(page).not_to have_content "Autogenerated password is" user = User.last within(".account-info") do @@ -128,7 +128,7 @@ feature 'Managed User' do click_button 'Create user' - expect(page).to_not have_content "We have sent an email" + expect(page).not_to have_content "We have sent an email" expect(page).to have_content "Autogenerated password is" user = User.last @@ -157,8 +157,8 @@ feature 'Managed User' do end expect(page).to have_content "User session signed out successfully." - expect(page).to_not have_content "Identified as" - expect(page).to_not have_content user.username.to_s + expect(page).not_to have_content "Identified as" + expect(page).not_to have_content user.username.to_s expect(page).to have_current_path(management_root_path) end diff --git a/spec/features/management/proposals_spec.rb b/spec/features/management/proposals_spec.rb index d73b14b06..02eaa18c1 100644 --- a/spec/features/management/proposals_spec.rb +++ b/spec/features/management/proposals_spec.rb @@ -101,7 +101,7 @@ feature 'Proposals' do expect(page).to have_css('.proposal', count: 1) expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal1.summary) - expect(page).to_not have_content(proposal2.title) + expect(page).not_to have_content(proposal2.title) expect(page).to have_css("a[href='#{management_proposal_path(proposal1)}']", text: proposal1.title) end end diff --git a/spec/features/management/users_spec.rb b/spec/features/management/users_spec.rb index 8060f33cb..0761c3136 100644 --- a/spec/features/management/users_spec.rb +++ b/spec/features/management/users_spec.rb @@ -22,13 +22,13 @@ feature 'Users' do click_button 'Create user' expect(page).to have_content "We have sent an email" - expect(page).to_not have_content "Autogenerated password is" + expect(page).not_to have_content "Autogenerated password is" user = User.find_by(email: 'pepe@gmail.com') expect(user).to be_level_three_verified expect(user).to be_residence_verified - expect(user).to_not be_confirmed + expect(user).not_to be_confirmed expect(user.date_of_birth).to have_content Date.new(1980, 12, 31) sent_token = /.*confirmation_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] @@ -61,7 +61,7 @@ feature 'Users' do click_button 'Create user' - expect(page).to_not have_content "We have sent an email" + expect(page).not_to have_content "We have sent an email" expect(page).to have_content "Autogenerated password is" user = User.find_by(username: 'Kelly Sue') @@ -79,7 +79,7 @@ feature 'Users' do fill_in 'document_verification_document_number', with: '12345678Z' click_button 'Check' - expect(page).to_not have_content "This user account is already verified." + expect(page).not_to have_content "This user account is already verified." expect(page).to have_content "This user can participate in the website with the following permissions" click_link "Delete user" diff --git a/spec/features/moderation/comments_spec.rb b/spec/features/moderation/comments_spec.rb index 2bf89bfaa..72f1f55f9 100644 --- a/spec/features/moderation/comments_spec.rb +++ b/spec/features/moderation/comments_spec.rb @@ -20,8 +20,8 @@ feature 'Moderate comments' do visit debate_path(comment.commentable) expect(page).to have_css('.comment', count: 1) - expect(page).to_not have_content('This comment has been deleted') - expect(page).to_not have_content('SPAM') + expect(page).not_to have_content('This comment has been deleted') + expect(page).not_to have_content('SPAM') end scenario 'Can not hide own comment' do @@ -32,8 +32,8 @@ feature 'Moderate comments' do visit debate_path(comment.commentable) within("#comment_#{comment.id}") do - expect(page).to_not have_link('Hide') - expect(page).to_not have_link('Block author') + expect(page).not_to have_link('Hide') + expect(page).not_to have_link('Block author') end end @@ -57,29 +57,29 @@ feature 'Moderate comments' do check "comment_#{@comment.id}_check" end - expect(page).to_not have_css("comment_#{@comment.id}") + expect(page).not_to have_css("comment_#{@comment.id}") end scenario 'Hide the comment' do click_on "Hide comments" - expect(page).to_not have_css("comment_#{@comment.id}") + expect(page).not_to have_css("comment_#{@comment.id}") expect(@comment.reload).to be_hidden - expect(@comment.user).to_not be_hidden + expect(@comment.user).not_to be_hidden end scenario 'Block the user' do click_on "Block authors" - expect(page).to_not have_css("comment_#{@comment.id}") + expect(page).not_to have_css("comment_#{@comment.id}") expect(@comment.reload).to be_hidden expect(@comment.user).to be_hidden end scenario 'Ignore the comment' do click_on "Mark as viewed" - expect(page).to_not have_css("comment_#{@comment.id}") + expect(page).not_to have_css("comment_#{@comment.id}") expect(@comment.reload).to be_ignored_flag - expect(@comment.reload).to_not be_hidden - expect(@comment.user).to_not be_hidden + expect(@comment.reload).not_to be_hidden + expect(@comment.user).not_to be_hidden end end @@ -95,7 +95,7 @@ feature 'Moderate comments' do within('.js-check') { click_on 'None' } all('input[type=checkbox]').each do |checkbox| - expect(checkbox).to_not be_checked + expect(checkbox).not_to be_checked end end @@ -116,13 +116,13 @@ feature 'Moderate comments' do scenario "Current filter is properly highlighted" do visit moderation_comments_path - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('All') expect(page).to have_link('Marked as viewed') visit moderation_comments_path(filter: 'all') within('.menu.simple') do - expect(page).to_not have_link('All') + expect(page).not_to have_link('All') expect(page).to have_link('Pending') expect(page).to have_link('Marked as viewed') end @@ -130,7 +130,7 @@ feature 'Moderate comments' do visit moderation_comments_path(filter: 'pending_flag_review') within('.menu.simple') do expect(page).to have_link('All') - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('Marked as viewed') end @@ -138,7 +138,7 @@ feature 'Moderate comments' do within('.menu.simple') do expect(page).to have_link('All') expect(page).to have_link('Pending') - expect(page).to_not have_link('Marked as viewed') + expect(page).not_to have_link('Marked as viewed') end end @@ -151,19 +151,19 @@ feature 'Moderate comments' do visit moderation_comments_path(filter: 'all') expect(page).to have_content('Regular comment') expect(page).to have_content('Pending comment') - expect(page).to_not have_content('Hidden comment') + expect(page).not_to have_content('Hidden comment') expect(page).to have_content('Ignored comment') visit moderation_comments_path(filter: 'pending_flag_review') - expect(page).to_not have_content('Regular comment') + expect(page).not_to have_content('Regular comment') expect(page).to have_content('Pending comment') - expect(page).to_not have_content('Hidden comment') - expect(page).to_not have_content('Ignored comment') + expect(page).not_to have_content('Hidden comment') + expect(page).not_to have_content('Ignored comment') visit moderation_comments_path(filter: 'with_ignored_flag') - expect(page).to_not have_content('Regular comment') - expect(page).to_not have_content('Pending comment') - expect(page).to_not have_content('Hidden comment') + expect(page).not_to have_content('Regular comment') + expect(page).not_to have_content('Pending comment') + expect(page).not_to have_content('Hidden comment') expect(page).to have_content('Ignored comment') end diff --git a/spec/features/moderation/debates_spec.rb b/spec/features/moderation/debates_spec.rb index f62ccd76b..b31d361b4 100644 --- a/spec/features/moderation/debates_spec.rb +++ b/spec/features/moderation/debates_spec.rb @@ -41,8 +41,8 @@ feature 'Moderate debates' do visit debate_path(debate) within("#debate_#{debate.id}") do - expect(page).to_not have_link('Hide') - expect(page).to_not have_link('Block author') + expect(page).not_to have_link('Hide') + expect(page).not_to have_link('Block author') end end @@ -66,29 +66,29 @@ feature 'Moderate debates' do check "debate_#{@debate.id}_check" end - expect(page).to_not have_css("debate_#{@debate.id}") + expect(page).not_to have_css("debate_#{@debate.id}") end scenario 'Hide the debate' do click_on "Hide debates" - expect(page).to_not have_css("debate_#{@debate.id}") + expect(page).not_to have_css("debate_#{@debate.id}") expect(@debate.reload).to be_hidden - expect(@debate.author).to_not be_hidden + expect(@debate.author).not_to be_hidden end scenario 'Block the author' do click_on "Block authors" - expect(page).to_not have_css("debate_#{@debate.id}") + expect(page).not_to have_css("debate_#{@debate.id}") expect(@debate.reload).to be_hidden expect(@debate.author).to be_hidden end scenario 'Ignore the debate' do click_on "Mark as viewed" - expect(page).to_not have_css("debate_#{@debate.id}") + expect(page).not_to have_css("debate_#{@debate.id}") expect(@debate.reload).to be_ignored_flag - expect(@debate.reload).to_not be_hidden - expect(@debate.author).to_not be_hidden + expect(@debate.reload).not_to be_hidden + expect(@debate.author).not_to be_hidden end end @@ -104,7 +104,7 @@ feature 'Moderate debates' do within('.js-check') { click_on 'None' } all('input[type=checkbox]').each do |checkbox| - expect(checkbox).to_not be_checked + expect(checkbox).not_to be_checked end end @@ -125,13 +125,13 @@ feature 'Moderate debates' do scenario "Current filter is properly highlighted" do visit moderation_debates_path - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('All') expect(page).to have_link('Marked as viewed') visit moderation_debates_path(filter: 'all') within('.menu.simple') do - expect(page).to_not have_link('All') + expect(page).not_to have_link('All') expect(page).to have_link('Pending') expect(page).to have_link('Marked as viewed') end @@ -139,7 +139,7 @@ feature 'Moderate debates' do visit moderation_debates_path(filter: 'pending_flag_review') within('.menu.simple') do expect(page).to have_link('All') - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('Marked as viewed') end @@ -147,7 +147,7 @@ feature 'Moderate debates' do within('.menu.simple') do expect(page).to have_link('All') expect(page).to have_link('Pending') - expect(page).to_not have_link('Marked as viewed') + expect(page).not_to have_link('Marked as viewed') end end @@ -160,19 +160,19 @@ feature 'Moderate debates' do visit moderation_debates_path(filter: 'all') expect(page).to have_content('Regular debate') expect(page).to have_content('Pending debate') - expect(page).to_not have_content('Hidden debate') + expect(page).not_to have_content('Hidden debate') expect(page).to have_content('Ignored debate') visit moderation_debates_path(filter: 'pending_flag_review') - expect(page).to_not have_content('Regular debate') + expect(page).not_to have_content('Regular debate') expect(page).to have_content('Pending debate') - expect(page).to_not have_content('Hidden debate') - expect(page).to_not have_content('Ignored debate') + expect(page).not_to have_content('Hidden debate') + expect(page).not_to have_content('Ignored debate') visit moderation_debates_path(filter: 'with_ignored_flag') - expect(page).to_not have_content('Regular debate') - expect(page).to_not have_content('Pending debate') - expect(page).to_not have_content('Hidden debate') + expect(page).not_to have_content('Regular debate') + expect(page).not_to have_content('Pending debate') + expect(page).not_to have_content('Hidden debate') expect(page).to have_content('Ignored debate') end diff --git a/spec/features/moderation/proposals_spec.rb b/spec/features/moderation/proposals_spec.rb index eb2e0e247..60ea01dbc 100644 --- a/spec/features/moderation/proposals_spec.rb +++ b/spec/features/moderation/proposals_spec.rb @@ -41,8 +41,8 @@ feature 'Moderate proposals' do visit proposal_path(proposal) within("#proposal_#{proposal.id}") do - expect(page).to_not have_link('Hide') - expect(page).to_not have_link('Block author') + expect(page).not_to have_link('Hide') + expect(page).not_to have_link('Block author') end end @@ -66,29 +66,29 @@ feature 'Moderate proposals' do check "proposal_#{@proposal.id}_check" end - expect(page).to_not have_css("proposal_#{@proposal.id}") + expect(page).not_to have_css("proposal_#{@proposal.id}") end scenario 'Hide the proposal' do click_on "Hide proposals" - expect(page).to_not have_css("proposal_#{@proposal.id}") + expect(page).not_to have_css("proposal_#{@proposal.id}") expect(@proposal.reload).to be_hidden - expect(@proposal.author).to_not be_hidden + expect(@proposal.author).not_to be_hidden end scenario 'Block the author' do click_on "Block authors" - expect(page).to_not have_css("proposal_#{@proposal.id}") + expect(page).not_to have_css("proposal_#{@proposal.id}") expect(@proposal.reload).to be_hidden expect(@proposal.author).to be_hidden end scenario 'Ignore the proposal' do click_button "Mark as viewed" - expect(page).to_not have_css("proposal_#{@proposal.id}") + expect(page).not_to have_css("proposal_#{@proposal.id}") expect(@proposal.reload).to be_ignored_flag - expect(@proposal.reload).to_not be_hidden - expect(@proposal.author).to_not be_hidden + expect(@proposal.reload).not_to be_hidden + expect(@proposal.author).not_to be_hidden end end @@ -104,7 +104,7 @@ feature 'Moderate proposals' do within('.js-check') { click_on 'None' } all('input[type=checkbox]').each do |checkbox| - expect(checkbox).to_not be_checked + expect(checkbox).not_to be_checked end end @@ -125,13 +125,13 @@ feature 'Moderate proposals' do scenario "Current filter is properly highlighted" do visit moderation_proposals_path - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('All') expect(page).to have_link('Mark as viewed') visit moderation_proposals_path(filter: 'all') within('.menu.simple') do - expect(page).to_not have_link('All') + expect(page).not_to have_link('All') expect(page).to have_link('Pending review') expect(page).to have_link('Mark as viewed') end @@ -139,7 +139,7 @@ feature 'Moderate proposals' do visit moderation_proposals_path(filter: 'pending_flag_review') within('.menu.simple') do expect(page).to have_link('All') - expect(page).to_not have_link('Pending') + expect(page).not_to have_link('Pending') expect(page).to have_link('Mark as viewed') end @@ -147,7 +147,7 @@ feature 'Moderate proposals' do within('.menu.simple') do expect(page).to have_link('All') expect(page).to have_link('Pending review') - expect(page).to_not have_link('Marked as viewed') + expect(page).not_to have_link('Marked as viewed') end end @@ -160,19 +160,19 @@ feature 'Moderate proposals' do visit moderation_proposals_path(filter: 'all') expect(page).to have_content('Regular proposal') expect(page).to have_content('Pending proposal') - expect(page).to_not have_content('Hidden proposal') + expect(page).not_to have_content('Hidden proposal') expect(page).to have_content('Ignored proposal') visit moderation_proposals_path(filter: 'pending_flag_review') - expect(page).to_not have_content('Regular proposal') + expect(page).not_to have_content('Regular proposal') expect(page).to have_content('Pending proposal') - expect(page).to_not have_content('Hidden proposal') - expect(page).to_not have_content('Ignored proposal') + expect(page).not_to have_content('Hidden proposal') + expect(page).not_to have_content('Ignored proposal') visit moderation_proposals_path(filter: 'with_ignored_flag') - expect(page).to_not have_content('Regular proposal') - expect(page).to_not have_content('Pending proposal') - expect(page).to_not have_content('Hidden proposal') + expect(page).not_to have_content('Regular proposal') + expect(page).not_to have_content('Pending proposal') + expect(page).not_to have_content('Hidden proposal') expect(page).to have_content('Ignored proposal') end diff --git a/spec/features/moderation/users_spec.rb b/spec/features/moderation/users_spec.rb index 93d654d33..697b11d34 100644 --- a/spec/features/moderation/users_spec.rb +++ b/spec/features/moderation/users_spec.rb @@ -29,13 +29,13 @@ feature 'Moderate users' do end expect(page).to have_current_path(debates_path) - expect(page).to_not have_content(debate1.title) - expect(page).to_not have_content(debate2.title) + expect(page).not_to have_content(debate1.title) + expect(page).not_to have_content(debate2.title) expect(page).to have_content(debate3.title) visit debate_path(debate3) - expect(page).to_not have_content(comment3.body) + expect(page).not_to have_content(comment3.body) click_link("Sign out") diff --git a/spec/features/moderation_spec.rb b/spec/features/moderation_spec.rb index 955805e73..785c15580 100644 --- a/spec/features/moderation_spec.rb +++ b/spec/features/moderation_spec.rb @@ -7,7 +7,7 @@ feature 'Moderation' do login_as(user) visit root_path - expect(page).to_not have_link("Moderation") + expect(page).not_to have_link("Moderation") visit moderation_root_path expect(page).not_to have_current_path(moderation_root_path) @@ -21,7 +21,7 @@ feature 'Moderation' do login_as(user) visit root_path - expect(page).to_not have_link("Moderation") + expect(page).not_to have_link("Moderation") visit moderation_root_path expect(page).not_to have_current_path(moderation_root_path) @@ -35,7 +35,7 @@ feature 'Moderation' do login_as(user) visit root_path - expect(page).to_not have_link("Moderation") + expect(page).not_to have_link("Moderation") visit moderation_root_path expect(page).not_to have_current_path(moderation_root_path) @@ -49,7 +49,7 @@ feature 'Moderation' do login_as(user) visit root_path - expect(page).to_not have_link("Moderation") + expect(page).not_to have_link("Moderation") visit moderation_root_path expect(page).not_to have_current_path(moderation_root_path) @@ -67,7 +67,7 @@ feature 'Moderation' do click_on "Moderation" expect(page).to have_current_path(moderation_root_path) - expect(page).to_not have_content "You do not have permission to access this page" + expect(page).not_to have_content "You do not have permission to access this page" end scenario 'Access as an administrator is authorized' do @@ -80,7 +80,7 @@ feature 'Moderation' do click_on "Moderation" expect(page).to have_current_path(moderation_root_path) - expect(page).to_not have_content "You do not have permission to access this page" + expect(page).not_to have_content "You do not have permission to access this page" end scenario "Moderation access links" do @@ -89,8 +89,8 @@ feature 'Moderation' do visit root_path expect(page).to have_link('Moderation') - expect(page).to_not have_link('Administration') - expect(page).to_not have_link('Valuation') + expect(page).not_to have_link('Administration') + expect(page).not_to have_link('Valuation') end context 'Moderation dashboard' do @@ -112,8 +112,8 @@ feature 'Moderation' do expect(page).to have_link('Go back to OrgName') expect(page).to have_current_path(moderation_root_path) expect(page).to have_css('#moderation_menu') - expect(page).to_not have_css('#admin_menu') - expect(page).to_not have_css('#valuation_menu') + expect(page).not_to have_css('#admin_menu') + expect(page).not_to have_css('#valuation_menu') end end end diff --git a/spec/features/officing/results_spec.rb b/spec/features/officing/results_spec.rb index 252d4edd6..91a194eec 100644 --- a/spec/features/officing/results_spec.rb +++ b/spec/features/officing/results_spec.rb @@ -34,9 +34,9 @@ feature 'Officing Results' do click_link 'Total recounts and results' end - expect(page).to_not have_content(not_allowed_poll_1.name) - expect(page).to_not have_content(not_allowed_poll_2.name) - expect(page).to_not have_content(not_allowed_poll_3.name) + expect(page).not_to have_content(not_allowed_poll_1.name) + expect(page).not_to have_content(not_allowed_poll_2.name) + expect(page).not_to have_content(not_allowed_poll_3.name) expect(page).to have_content(@poll.name) visit new_officing_poll_result_path(not_allowed_poll_1) @@ -55,7 +55,7 @@ feature 'Officing Results' do click_link 'Add results' end - expect(page).to_not have_content('Your results') + expect(page).not_to have_content('Your results') booth_name = @officer_assignment.booth_assignment.booth.name select booth_name, from: 'officer_assignment_id' @@ -113,7 +113,7 @@ feature 'Officing Results' do click_link "See results" end - expect(page).to_not have_content('7777') + expect(page).not_to have_content('7777') within("#white_results") { expect(page).to have_content('6') } within("#null_results") { expect(page).to have_content('7') } within("#total_results") { expect(page).to have_content('8') } diff --git a/spec/features/officing/voters_spec.rb b/spec/features/officing/voters_spec.rb index 2c4b17d37..135bebdc8 100644 --- a/spec/features/officing/voters_spec.rb +++ b/spec/features/officing/voters_spec.rb @@ -24,11 +24,11 @@ feature 'Voters' do click_button "Confirm vote" expect(page).to have_content "Vote introduced!" - expect(page).to_not have_button "Confirm vote" + expect(page).not_to have_button "Confirm vote" page.evaluate_script("window.location.reload()") expect(page).to have_content "Has already participated in this poll" - expect(page).to_not have_button "Confirm vote" + expect(page).not_to have_button "Confirm vote" expect(Poll::Voter.last.officer_id).to eq(officer.id) end @@ -45,7 +45,7 @@ feature 'Voters' do within("#poll_#{poll.id}") do expect(page).to have_content "Has already participated in this poll" - expect(page).to_not have_button "Confirm vote" + expect(page).not_to have_button "Confirm vote" end within("#poll_#{poll2.id}") do @@ -55,7 +55,7 @@ feature 'Voters' do scenario "Had already verified his residence, but is not level 2 yet", :js do user = create(:user, residence_verified_at: Time.current, document_type: "1", document_number: "12345678Z") - expect(user).to_not be_level_two_verified + expect(user).not_to be_level_two_verified visit new_officing_residence_path officing_verify_residence diff --git a/spec/features/officing_spec.rb b/spec/features/officing_spec.rb index d01cd84be..f2d31c334 100644 --- a/spec/features/officing_spec.rb +++ b/spec/features/officing_spec.rb @@ -8,7 +8,7 @@ feature 'Poll Officing' do login_as(user) visit root_path - expect(page).to_not have_link("Polling officers") + expect(page).not_to have_link("Polling officers") visit officing_root_path expect(page).not_to have_current_path(officing_root_path) @@ -21,7 +21,7 @@ feature 'Poll Officing' do login_as(user) visit root_path - expect(page).to_not have_link("Polling officers") + expect(page).not_to have_link("Polling officers") visit officing_root_path expect(page).not_to have_current_path(officing_root_path) @@ -34,7 +34,7 @@ feature 'Poll Officing' do login_as(user) visit root_path - expect(page).to_not have_link("Polling officers") + expect(page).not_to have_link("Polling officers") visit officing_root_path expect(page).not_to have_current_path(officing_root_path) @@ -47,7 +47,7 @@ feature 'Poll Officing' do login_as(user) visit root_path - expect(page).to_not have_link("Polling officers") + expect(page).not_to have_link("Polling officers") visit officing_root_path expect(page).not_to have_current_path(officing_root_path) @@ -61,7 +61,7 @@ feature 'Poll Officing' do login_as(user) visit root_path - expect(page).to_not have_link("Polling officers") + expect(page).not_to have_link("Polling officers") visit officing_root_path expect(page).not_to have_current_path(officing_root_path) @@ -80,7 +80,7 @@ feature 'Poll Officing' do click_on "Polling officers" expect(page).to have_current_path(officing_root_path) - expect(page).to_not have_content "You do not have permission to access this page" + expect(page).not_to have_content "You do not have permission to access this page" end scenario 'Access as an poll officer is authorized' do @@ -93,7 +93,7 @@ feature 'Poll Officing' do click_on "Polling officers" expect(page).to have_current_path(officing_root_path) - expect(page).to_not have_content "You do not have permission to access this page" + expect(page).not_to have_content "You do not have permission to access this page" end scenario "Poll officer access links" do @@ -102,9 +102,9 @@ feature 'Poll Officing' do visit root_path expect(page).to have_link("Polling officers") - expect(page).to_not have_link('Valuation') - expect(page).to_not have_link('Administration') - expect(page).to_not have_link('Moderation') + expect(page).not_to have_link('Valuation') + expect(page).not_to have_link('Administration') + expect(page).not_to have_link('Moderation') end scenario 'Officing dashboard' do @@ -117,9 +117,9 @@ feature 'Poll Officing' do expect(page).to have_current_path(officing_root_path) expect(page).to have_css('#officing_menu') - expect(page).to_not have_css('#valuation_menu') - expect(page).to_not have_css('#admin_menu') - expect(page).to_not have_css('#moderation_menu') + expect(page).not_to have_css('#valuation_menu') + expect(page).not_to have_css('#admin_menu') + expect(page).not_to have_css('#moderation_menu') end scenario 'Officing dashboard available for multiple sessions', :js do diff --git a/spec/features/organizations_spec.rb b/spec/features/organizations_spec.rb index 5af1905bb..e2183bf25 100644 --- a/spec/features/organizations_spec.rb +++ b/spec/features/organizations_spec.rb @@ -4,7 +4,7 @@ feature 'Organizations' do scenario 'Organizations can be created' do user = User.organizations.where(email: 'green@peace.com').first - expect(user).to_not be + expect(user).not_to be visit new_organization_registration_path @@ -20,7 +20,7 @@ feature 'Organizations' do user = User.organizations.where(email: 'green@peace.com').first expect(user).to be expect(user).to be_organization - expect(user.organization).to_not be_verified + expect(user.organization).not_to be_verified end scenario 'Create with invisible_captcha honeypot field' do @@ -76,6 +76,6 @@ feature 'Organizations' do visit new_user_session_path expect(page).to have_link "Sign up" - expect(page).to_not have_link "Sign up as an organization" + expect(page).not_to have_link "Sign up as an organization" end end diff --git a/spec/features/polls/polls_spec.rb b/spec/features/polls/polls_spec.rb index 791bc3167..c2e8413cf 100644 --- a/spec/features/polls/polls_spec.rb +++ b/spec/features/polls/polls_spec.rb @@ -31,37 +31,37 @@ feature 'Polls' do visit polls_path expect(page).to have_content('Current poll') expect(page).to have_link('Participate in this poll') - expect(page).to_not have_content('Incoming poll') - expect(page).to_not have_content('Expired poll') + expect(page).not_to have_content('Incoming poll') + expect(page).not_to have_content('Expired poll') visit polls_path(filter: 'incoming') - expect(page).to_not have_content('Current poll') + expect(page).not_to have_content('Current poll') expect(page).to have_content('Incoming poll') expect(page).to have_link('More information') - expect(page).to_not have_content('Expired poll') + expect(page).not_to have_content('Expired poll') visit polls_path(filter: 'expired') - expect(page).to_not have_content('Current poll') - expect(page).to_not have_content('Incoming poll') + expect(page).not_to have_content('Current poll') + expect(page).not_to have_content('Incoming poll') expect(page).to have_content('Expired poll') expect(page).to have_link('Poll ended') end scenario "Current filter is properly highlighted" do visit polls_path - expect(page).to_not have_link('Open') + expect(page).not_to have_link('Open') expect(page).to have_link('Incoming') expect(page).to have_link('Expired') visit polls_path(filter: 'incoming') expect(page).to have_link('Open') - expect(page).to_not have_link('Incoming') + expect(page).not_to have_link('Incoming') expect(page).to have_link('Expired') visit polls_path(filter: 'expired') expect(page).to have_link('Open') expect(page).to have_link('Incoming') - expect(page).to_not have_link('Expired') + expect(page).not_to have_link('Expired') end scenario "Poll title link to stats if enabled" do @@ -143,13 +143,13 @@ feature 'Polls' do expect(page).to have_content('Chewbacca') expect(page).to have_content('You must Sign in or Sign up to participate') - expect(page).to_not have_link('Han Solo') - expect(page).to_not have_link('Chewbacca') + expect(page).not_to have_link('Han Solo') + expect(page).not_to have_link('Chewbacca') end scenario 'Level 1 users' do visit polls_path - expect(page).to_not have_selector('.already-answer') + expect(page).not_to have_selector('.already-answer') poll.update(geozone_restricted: true) poll.geozones << geozone @@ -166,8 +166,8 @@ feature 'Polls' do expect(page).to have_content('Han Solo') expect(page).to have_content('Chewbacca') - expect(page).to_not have_link('Han Solo') - expect(page).to_not have_link('Chewbacca') + expect(page).not_to have_link('Han Solo') + expect(page).not_to have_link('Chewbacca') end scenario 'Level 2 users in an incoming poll' do @@ -184,8 +184,8 @@ feature 'Polls' do expect(page).to have_content('Rey') expect(page).to have_content('Finn') - expect(page).to_not have_link('Rey') - expect(page).to_not have_link('Finn') + expect(page).not_to have_link('Rey') + expect(page).not_to have_link('Finn') expect(page).to have_content('This poll has not yet started') end @@ -204,8 +204,8 @@ feature 'Polls' do expect(page).to have_content('Luke') expect(page).to have_content('Leia') - expect(page).to_not have_link('Luke') - expect(page).to_not have_link('Leia') + expect(page).not_to have_link('Luke') + expect(page).not_to have_link('Leia') expect(page).to have_content('This poll has finished') end @@ -224,8 +224,8 @@ feature 'Polls' do expect(page).to have_content('Vader') expect(page).to have_content('Palpatine') - expect(page).to_not have_link('Vader') - expect(page).to_not have_link('Palpatine') + expect(page).not_to have_link('Vader') + expect(page).not_to have_link('Palpatine') end scenario 'Level 2 users reading a same-geozone poll' do @@ -284,7 +284,7 @@ feature 'Polls' do click_link 'Han Solo' - expect(page).to_not have_link('Han Solo') + expect(page).not_to have_link('Han Solo') expect(page).to have_link('Chewbacca') end @@ -303,12 +303,12 @@ feature 'Polls' do click_link 'Han Solo' - expect(page).to_not have_link('Han Solo') + expect(page).not_to have_link('Han Solo') expect(page).to have_link('Chewbacca') click_link 'Chewbacca' - expect(page).to_not have_link('Chewbacca') + expect(page).not_to have_link('Chewbacca') expect(page).to have_link('Han Solo') end @@ -326,7 +326,7 @@ feature 'Polls' do visit poll_path(poll) click_link 'Han Solo' - expect(page).to_not have_link('Han Solo') + expect(page).not_to have_link('Han Solo') expect(page).to have_link('Chewbacca') click_link "Sign out" @@ -334,7 +334,7 @@ feature 'Polls' do visit poll_path(poll) click_link 'Han Solo' - expect(page).to_not have_link('Han Solo') + expect(page).not_to have_link('Han Solo') expect(page).to have_link('Chewbacca') click_link "Sign out" @@ -342,7 +342,7 @@ feature 'Polls' do visit poll_path(poll) click_link 'Chewbacca' - expect(page).to_not have_link('Chewbacca') + expect(page).not_to have_link('Chewbacca') expect(page).to have_link('Han Solo') end end @@ -381,8 +381,8 @@ feature 'Polls' do expect(page).to have_content('Han Solo') expect(page).to have_content('Chewbacca') - expect(page).to_not have_link('Han Solo') - expect(page).to_not have_link('Chewbacca') + expect(page).not_to have_link('Han Solo') + expect(page).not_to have_link('Chewbacca') end end @@ -413,8 +413,8 @@ feature 'Polls' do login_as user visit poll_path(poll) - expect(page).to_not have_content("Poll results") - expect(page).to_not have_content("Participation statistics") + expect(page).not_to have_content("Poll results") + expect(page).not_to have_content("Participation statistics") visit results_poll_path(poll) expect(page).to have_content("You do not have permission to carry out the action 'results' on poll.") @@ -430,8 +430,8 @@ feature 'Polls' do login_as user visit poll_path(poll) - expect(page).to_not have_content("Poll results") - expect(page).to_not have_content("Participation statistics") + expect(page).not_to have_content("Poll results") + expect(page).not_to have_content("Participation statistics") visit results_poll_path(poll) expect(page).to have_content("You do not have permission to carry out the action 'results' on poll.") diff --git a/spec/features/polls/voter_spec.rb b/spec/features/polls/voter_spec.rb index 2f062df7d..25817bff6 100644 --- a/spec/features/polls/voter_spec.rb +++ b/spec/features/polls/voter_spec.rb @@ -26,7 +26,7 @@ feature "Voter" do within("#poll_question_#{question.id}_answers") do click_link answer_yes.title - expect(page).to_not have_link(answer_yes.title) + expect(page).not_to have_link(answer_yes.title) end find(:css, ".js-token-message").should be_visible @@ -45,12 +45,12 @@ feature "Voter" do visit poll_path(poll) within("#poll_question_#{question.id}_answers") do - expect(page).to_not have_link(answer_yes.title, href: "/questions/#{question.id}/answer?answer=#{answer_yes.title}&token=") - expect(page).to_not have_link(answer_no.title, href: "/questions/#{question.id}/answer?answer=#{answer_no.title}&token=") + expect(page).not_to have_link(answer_yes.title, href: "/questions/#{question.id}/answer?answer=#{answer_yes.title}&token=") + expect(page).not_to have_link(answer_no.title, href: "/questions/#{question.id}/answer?answer=#{answer_no.title}&token=") end expect(page).to have_content("You must verify your account in order to answer") - expect(page).to_not have_content("You have already participated in this poll. If you vote again it will be overwritten") + expect(page).not_to have_content("You have already participated in this poll. If you vote again it will be overwritten") end scenario "Voting in booth", :js do @@ -65,7 +65,7 @@ feature "Voter" do within("#poll_#{poll.id}") do click_button("Confirm vote") - expect(page).to_not have_button("Confirm vote") + expect(page).not_to have_button("Confirm vote") expect(page).to have_button('Wait, confirming vote...', disabled: true) expect(page).to have_content "Vote introduced!" end @@ -94,7 +94,7 @@ feature "Voter" do officing_verify_residence expect(page).to have_content poll.name - expect(page).to_not have_button "Confirm vote" + expect(page).not_to have_button "Confirm vote" expect(page).to have_content "Has already participated in this poll" end @@ -109,7 +109,7 @@ feature "Voter" do login_as user visit poll_path(poll) - expect(page).to_not have_link(answer_yes.title) + expect(page).not_to have_link(answer_yes.title) expect(page).to have_content "You have already participated in a physical booth. You can not participate again." expect(Poll::Voter.count).to eq(1) end @@ -121,11 +121,11 @@ feature "Voter" do visit poll_path(poll) - expect(page).to_not have_selector('.js-token-message') + expect(page).not_to have_selector('.js-token-message') expect(page).to have_content "You have already participated in this poll. If you vote again it will be overwritten." within("#poll_question_#{question.id}_answers") do - expect(page).to_not have_link(answer_yes.title) + expect(page).not_to have_link(answer_yes.title) end click_link "Sign out" @@ -158,7 +158,7 @@ feature "Voter" do visit poll_path(poll) - expect(page).to_not have_link(answer_yes.title) + expect(page).not_to have_link(answer_yes.title) expect(page).to have_content "You have already participated in a physical booth. You can not participate again." expect(Poll::Voter.count).to eq(1) end diff --git a/spec/features/proposal_notifications_spec.rb b/spec/features/proposal_notifications_spec.rb index 439dc19a2..647ad88c8 100644 --- a/spec/features/proposal_notifications_spec.rb +++ b/spec/features/proposal_notifications_spec.rb @@ -177,7 +177,7 @@ feature 'Proposal Notifications' do visit user_path(author) within("#proposal_#{proposal.id}") do - expect(page).to_not have_link "Send message" + expect(page).not_to have_link "Send message" end end @@ -339,7 +339,7 @@ feature 'Proposal Notifications' do notification_for_user = Notification.where(user: user).first expect(page).to have_css ".notification", count: 1 expect(page).to have_content "This resource is not available anymore" - expect(page).to_not have_xpath "//a[@href='#{notification_path(notification_for_user)}']" + expect(page).not_to have_xpath "//a[@href='#{notification_path(notification_for_user)}']" end scenario "Proposal retired by author", :js do diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 93b5d0998..c6b966304 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -59,7 +59,7 @@ feature 'Proposals' do within("ul.pagination") do expect(page).to have_content("1") expect(page).to have_link('2', href: 'http://www.example.com/proposals?page=2') - expect(page).to_not have_content("3") + expect(page).not_to have_content("3") click_link "Next", exact: false end @@ -75,7 +75,7 @@ feature 'Proposals' do visit proposals_path(proposal) within("#proposal_#{proposal.id}") do - expect(page).to_not have_css("div.with-image") + expect(page).not_to have_css("div.with-image") end within("#proposal_#{proposal_with_image.id}") do expect(page).to have_css("img[alt='#{proposal_with_image.image.title}']") @@ -165,7 +165,7 @@ feature 'Proposals' do proposal = create(:proposal, video_url: nil) visit proposal_path(proposal) - expect(page).to_not have_selector("div[id='js-embedded-video']") + expect(page).not_to have_selector("div[id='js-embedded-video']") end end @@ -311,7 +311,7 @@ feature 'Proposals' do login_as(author) visit new_proposal_path - expect(page).to_not have_selector('#proposal_responsible_name') + expect(page).not_to have_selector('#proposal_responsible_name') fill_in 'proposal_title', with: 'Help refugees' fill_in 'proposal_question', with: '¿Would you like to give assistance to war refugees?' @@ -359,8 +359,8 @@ feature 'Proposals' do expect(page).to have_content 'Testing an attack' expect(page.html).to include '

This is alert("an attack");

' - expect(page.html).to_not include '' - expect(page.html).to_not include '<p>This is' + expect(page.html).not_to include '' + expect(page.html).not_to include '<p>This is' end scenario 'Autolinking is applied to description' do @@ -407,13 +407,13 @@ feature 'Proposals' do expect(page).to have_content 'Testing auto link' expect(page).to have_link('http://example.org', href: 'http://example.org') expect(page).not_to have_link('click me') - expect(page.html).to_not include "" + expect(page.html).not_to include "" click_link 'Edit' expect(page).to have_current_path(edit_proposal_path(Proposal.last)) expect(page).not_to have_link('click me') - expect(page.html).to_not include "" + expect(page.html).not_to include "" end context 'Geozones' do @@ -508,7 +508,7 @@ feature 'Proposals' do click_button 'Retire proposal' - expect(page).to_not have_content 'Proposal retired' + expect(page).not_to have_content 'Proposal retired' expect(page).to have_content "can't be blank", count: 2 end @@ -522,7 +522,7 @@ feature 'Proposals' do expect(page).to have_selector('#proposals .proposal', count: 1) within('#proposals') do expect(page).to have_content not_retired.title - expect(page).to_not have_content retired.title + expect(page).not_to have_content retired.title end end @@ -533,19 +533,19 @@ feature 'Proposals' do visit proposals_path - expect(page).to_not have_content retired.title + expect(page).not_to have_content retired.title click_link 'Proposals retired by the author' expect(page).to have_content retired.title - expect(page).to_not have_content not_retired.title + expect(page).not_to have_content not_retired.title end scenario 'Retired proposals index interface elements' do visit proposals_path(retired: 'all') - expect(page).to_not have_content 'Advanced search' - expect(page).to_not have_content 'Categories' - expect(page).to_not have_content 'Districts' + expect(page).not_to have_content 'Advanced search' + expect(page).not_to have_content 'Categories' + expect(page).not_to have_content 'Districts' end scenario 'Retired proposals index has links to filter by retired_reason' do @@ -565,7 +565,7 @@ feature 'Proposals' do click_link 'Unfeasible' expect(page).to have_content unfeasible.title - expect(page).to_not have_content duplicated.title + expect(page).not_to have_content duplicated.title end end @@ -585,7 +585,7 @@ feature 'Proposals' do Setting["max_votes_for_proposal_edit"] = 10 11.times { create(:vote, votable: proposal) } - expect(proposal).to_not be_editable + expect(proposal).not_to be_editable login_as(proposal.author) visit edit_proposal_path(proposal) @@ -778,7 +778,7 @@ feature 'Proposals' do visit proposals_path within("#proposals-list") do - expect(page).to_not have_content archived_proposal.title + expect(page).not_to have_content archived_proposal.title end orders = %w{hot_score confidence_score created_at relevance} @@ -786,7 +786,7 @@ feature 'Proposals' do visit proposals_path(order: order) within("#proposals-list") do - expect(page).to_not have_content archived_proposal.title + expect(page).not_to have_content archived_proposal.title end end end @@ -821,21 +821,21 @@ feature 'Proposals' do within("#featured-proposals") do expect(page).to have_content(featured_proposal.title) - expect(page).to_not have_content(archived_proposal.title) + expect(page).not_to have_content(archived_proposal.title) end within("#proposals-list") do - expect(page).to_not have_content(featured_proposal.title) - expect(page).to_not have_content(archived_proposal.title) + expect(page).not_to have_content(featured_proposal.title) + expect(page).not_to have_content(archived_proposal.title) end click_link "archived" within("#featured-proposals") do expect(page).to have_content(featured_proposal.title) - expect(page).to_not have_content(archived_proposal.title) + expect(page).not_to have_content(archived_proposal.title) end within("#proposals-list") do - expect(page).to_not have_content(featured_proposal.title) + expect(page).not_to have_content(featured_proposal.title) expect(page).to have_content(archived_proposal.title) end end @@ -878,7 +878,7 @@ feature 'Proposals' do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -897,7 +897,7 @@ feature 'Proposals' do expect(page).to have_css('.proposal', count: 1) expect(page).to have_content(proposal1.title) - expect(page).to_not have_content(proposal2.title) + expect(page).not_to have_content(proposal2.title) end end @@ -933,7 +933,7 @@ feature 'Proposals' do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -958,7 +958,7 @@ feature 'Proposals' do within("#proposals") do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -981,7 +981,7 @@ feature 'Proposals' do within("#proposals") do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -1004,7 +1004,7 @@ feature 'Proposals' do within("#proposals") do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -1027,7 +1027,7 @@ feature 'Proposals' do within("#proposals") do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -1050,7 +1050,7 @@ feature 'Proposals' do within("#proposals") do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -1076,7 +1076,7 @@ feature 'Proposals' do within("#proposals") do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -1096,7 +1096,7 @@ feature 'Proposals' do within("#proposals") do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -1116,7 +1116,7 @@ feature 'Proposals' do within("#proposals") do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -1136,7 +1136,7 @@ feature 'Proposals' do within("#proposals") do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -1160,7 +1160,7 @@ feature 'Proposals' do within("#proposals") do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -1284,7 +1284,7 @@ feature 'Proposals' do expect(all(".proposal")[0].text).to match "Show you got" expect(all(".proposal")[1].text).to match "Show you got" expect(all(".proposal")[2].text).to match "Show what you got" - expect(page).to_not have_content "Do not display" + expect(page).not_to have_content "Do not display" end end @@ -1308,8 +1308,8 @@ feature 'Proposals' do within("#proposals") do expect(all(".proposal")[0].text).to match "Show you got" expect(all(".proposal")[1].text).to match "Show what you got" - expect(page).to_not have_content "Do not display with same tag" - expect(page).to_not have_content "Do not display" + expect(page).not_to have_content "Do not display with same tag" + expect(page).not_to have_content "Do not display" end Setting['feature.user.recommendations'] = nil end @@ -1324,8 +1324,8 @@ feature 'Proposals' do click_button "Search" end - expect(page).to_not have_selector('#proposals .proposal-featured') - expect(page).to_not have_selector('#featured-proposals') + expect(page).not_to have_selector('#proposals .proposal-featured') + expect(page).not_to have_selector('#featured-proposals') end end @@ -1338,7 +1338,7 @@ feature 'Proposals' do expect(page).to have_content "This proposal has been flagged as inappropriate by several users." visit proposal_path(good_proposal) - expect(page).to_not have_content "This proposal has been flagged as inappropriate by several users." + expect(page).not_to have_content "This proposal has been flagged as inappropriate by several users." end scenario "Flagging", :js do @@ -1373,7 +1373,7 @@ feature 'Proposals' do expect(page).to have_css("#flag-expand-proposal-#{proposal.id}") end - expect(Flag.flagged?(user, proposal)).to_not be + expect(Flag.flagged?(user, proposal)).not_to be end scenario 'Flagging/Unflagging AJAX', :js do @@ -1401,7 +1401,7 @@ feature 'Proposals' do expect(page).to have_css("#flag-expand-proposal-#{proposal.id}") end - expect(Flag.flagged?(user, proposal)).to_not be + expect(Flag.flagged?(user, proposal)).not_to be end it_behaves_like "followable", "proposal", "proposal_path", { "id": "id" } @@ -1495,7 +1495,7 @@ feature 'Proposals' do expect(page).to have_css('.proposal', count: 2) expect(page).to have_content(@proposal1.title) expect(page).to have_content(@proposal2.title) - expect(page).to_not have_content(@proposal3.title) + expect(page).not_to have_content(@proposal3.title) end end @@ -1510,7 +1510,7 @@ feature 'Proposals' do expect(page).to have_css('.proposal', count: 2) expect(page).to have_content(@proposal1.title) expect(page).to have_content(@proposal2.title) - expect(page).to_not have_content(@proposal3.title) + expect(page).not_to have_content(@proposal3.title) end end @@ -1525,7 +1525,7 @@ feature 'Proposals' do expect(page).to have_css('.proposal', count: 2) expect(page).to have_content(@proposal1.title) expect(page).to have_content(@proposal2.title) - expect(page).to_not have_content(@proposal3.title) + expect(page).not_to have_content(@proposal3.title) end end @@ -1566,7 +1566,7 @@ feature 'Proposals' do check "proposal_terms_of_service" within('div#js-suggest') do - expect(page).to_not have_content 'You are seeing' + expect(page).not_to have_content 'You are seeing' end end end @@ -1654,7 +1654,7 @@ feature 'Proposals' do expect(page).to have_content(proposal1.title) expect(page).to have_content(proposal2.title) - expect(page).to_not have_content(proposal3.title) + expect(page).not_to have_content(proposal3.title) end end @@ -1671,7 +1671,7 @@ feature 'Successful proposals' do successful_proposals.each do |proposal| within("#proposal_#{proposal.id}_votes") do - expect(page).to_not have_css(".supports") + expect(page).not_to have_css(".supports") expect(page).to have_content "This proposal has reached the required supports" end end @@ -1683,7 +1683,7 @@ feature 'Successful proposals' do successful_proposals.each do |proposal| visit proposal_path(proposal) within("#proposal_#{proposal.id}_votes") do - expect(page).to_not have_css(".supports") + expect(page).not_to have_css(".supports") expect(page).to have_content "This proposal has reached the required supports" end end @@ -1696,7 +1696,7 @@ feature 'Successful proposals' do successful_proposals.each do |proposal| within("#proposal_#{proposal.id}_votes") do - expect(page).to_not have_link "Create question" + expect(page).not_to have_link "Create question" end end diff --git a/spec/features/registration_form_spec.rb b/spec/features/registration_form_spec.rb index 5b650911f..e6428dd60 100644 --- a/spec/features/registration_form_spec.rb +++ b/spec/features/registration_form_spec.rb @@ -6,7 +6,7 @@ feature 'Registration form' do user = create(:user) visit new_user_registration_path - expect(page).to_not have_content I18n.t("devise_views.users.registrations.new.username_is_not_available") + expect(page).not_to have_content I18n.t("devise_views.users.registrations.new.username_is_not_available") fill_in "user_username", with: user.username check 'user_terms_of_service' @@ -16,7 +16,7 @@ feature 'Registration form' do scenario 'username is available', :js do visit new_user_registration_path - expect(page).to_not have_content I18n.t("devise_views.users.registrations.new.username_is_available") + expect(page).not_to have_content I18n.t("devise_views.users.registrations.new.username_is_available") fill_in "user_username", with: "available username" check 'user_terms_of_service' diff --git a/spec/features/site_customization/content_blocks_spec.rb b/spec/features/site_customization/content_blocks_spec.rb index 995982063..6e5de3a7c 100644 --- a/spec/features/site_customization/content_blocks_spec.rb +++ b/spec/features/site_customization/content_blocks_spec.rb @@ -8,12 +8,12 @@ feature "Custom content blocks" do visit "/?locale=en" expect(page).to have_content("content for top links") - expect(page).to_not have_content("contenido para top links") + expect(page).not_to have_content("contenido para top links") visit "/?locale=es" expect(page).to have_content("contenido para top links") - expect(page).to_not have_content("content for top links") + expect(page).not_to have_content("content for top links") end scenario "footer" do @@ -23,11 +23,11 @@ feature "Custom content blocks" do visit "/?locale=en" expect(page).to have_content("content for footer") - expect(page).to_not have_content("contenido para footer") + expect(page).not_to have_content("contenido para footer") visit "/?locale=es" expect(page).to have_content("contenido para footer") - expect(page).to_not have_content("content for footer") + expect(page).not_to have_content("content for footer") end end diff --git a/spec/features/site_customization/custom_pages_spec.rb b/spec/features/site_customization/custom_pages_spec.rb index 653f783cd..38c2536e1 100644 --- a/spec/features/site_customization/custom_pages_spec.rb +++ b/spec/features/site_customization/custom_pages_spec.rb @@ -69,7 +69,7 @@ feature "Custom Pages" do expect(page).to have_title("Custom page") expect(page).to have_selector("h1", text: "Custom page") expect(page).to have_content("Text for new custom page") - expect(page).to_not have_content("Print this info") + expect(page).not_to have_content("Print this info") end scenario "Listed in more information page" do @@ -95,7 +95,7 @@ feature "Custom Pages" do visit more_info_path - expect(page).to_not have_content("Another custom page") + expect(page).not_to have_content("Another custom page") visit custom_page.url @@ -114,7 +114,7 @@ feature "Custom Pages" do visit more_info_path - expect(page).to_not have_content("Ce texte est en français") + expect(page).not_to have_content("Ce texte est en français") visit custom_page.url diff --git a/spec/features/tags/budget_investments_spec.rb b/spec/features/tags/budget_investments_spec.rb index 43edc9c36..74523f81b 100644 --- a/spec/features/tags/budget_investments_spec.rb +++ b/spec/features/tags/budget_investments_spec.rb @@ -95,7 +95,7 @@ feature 'Tags' do within "#tags_budget_investment_#{Budget::Investment.last.id}" do expect(page).to have_content tag_economia.name - expect(page).to_not have_content tag_medio_ambiente.name + expect(page).not_to have_content tag_medio_ambiente.name end end @@ -135,7 +135,7 @@ feature 'Tags' do expect(page).to have_content 'user_id1' expect(page).to have_content 'a3' expect(page).to have_content 'scriptalert("hey");script' - expect(page.html).to_not include 'user_id=1, &a=3, ' + expect(page.html).not_to include 'user_id=1, &a=3, ' end context "Filter" do @@ -214,7 +214,7 @@ feature 'Tags' do expect(page).to have_css ".budget-investment", count: 2 expect(page).to have_content investment1.title expect(page).to have_content investment2.title - expect(page).to_not have_content investment3.title + expect(page).not_to have_content investment3.title end end @@ -259,7 +259,7 @@ feature 'Tags' do expect(page).to have_css ".budget-investment", count: 2 expect(page).to have_content investment1.title expect(page).to have_content investment2.title - expect(page).to_not have_content investment3.title + expect(page).not_to have_content investment3.title end end end @@ -274,7 +274,7 @@ feature 'Tags' do visit budget_investment_path(budget, investment) expect(page).to have_content 'Park' - expect(page).to_not have_content 'Education' + expect(page).not_to have_content 'Education' end scenario "Valuators do not see user tags" do @@ -289,7 +289,7 @@ feature 'Tags' do click_link 'Edit classification' expect(page).to have_content 'Education' - expect(page).to_not have_content 'Park' + expect(page).not_to have_content 'Park' end end diff --git a/spec/features/tags/debates_spec.rb b/spec/features/tags/debates_spec.rb index 6bfca4772..99578b3e1 100644 --- a/spec/features/tags/debates_spec.rb +++ b/spec/features/tags/debates_spec.rb @@ -48,8 +48,8 @@ feature 'Tags' do visit debates_path(tag: "123") - expect(page).to_not have_selector('#debates .debate-featured') - expect(page).to_not have_selector('#featured-debates') + expect(page).not_to have_selector('#debates .debate-featured') + expect(page).not_to have_selector('#featured-debates') end scenario 'Show' do @@ -115,7 +115,7 @@ feature 'Tags' do expect(page).to have_content 'user_id1' expect(page).to have_content 'a3' expect(page).to have_content 'scriptalert("hey");script' - expect(page.html).to_not include 'user_id=1, &a=3, ' + expect(page.html).not_to include 'user_id=1, &a=3, ' end scenario 'Update' do @@ -146,7 +146,7 @@ feature 'Tags' do click_button 'Save changes' expect(page).to have_content 'Debate updated successfully.' - expect(page).to_not have_content 'Economía' + expect(page).not_to have_content 'Economía' end context "Filter" do @@ -211,7 +211,7 @@ feature 'Tags' do expect(page).to have_css ".debate", count: 2 expect(page).to have_content debate1.title expect(page).to have_content debate2.title - expect(page).to_not have_content debate3.title + expect(page).not_to have_content debate3.title end end diff --git a/spec/features/tags/proposals_spec.rb b/spec/features/tags/proposals_spec.rb index d2a16b8f7..7c8a5c026 100644 --- a/spec/features/tags/proposals_spec.rb +++ b/spec/features/tags/proposals_spec.rb @@ -36,8 +36,8 @@ feature 'Tags' do visit proposals_path(tag: "123") - expect(page).to_not have_selector('#proposals .proposal-featured') - expect(page).to_not have_selector('#featured-proposals') + expect(page).not_to have_selector('#proposals .proposal-featured') + expect(page).not_to have_selector('#featured-proposals') end scenario 'Index shows 3 tags with no plus link' do @@ -114,7 +114,7 @@ feature 'Tags' do within "#tags_proposal_#{Proposal.last.id}" do expect(page).to have_content 'Education' - expect(page).to_not have_content 'Health' + expect(page).not_to have_content 'Health' end end @@ -160,7 +160,7 @@ feature 'Tags' do expect(page).to have_content 'user_id1' expect(page).to have_content 'a3' expect(page).to have_content 'scriptalert("hey");script' - expect(page.html).to_not include 'user_id=1, &a=3, ' + expect(page.html).not_to include 'user_id=1, &a=3, ' end scenario 'Update' do @@ -191,7 +191,7 @@ feature 'Tags' do click_button 'Save changes' expect(page).to have_content 'Proposal updated successfully.' - expect(page).to_not have_content 'Economía' + expect(page).not_to have_content 'Economía' end context "Filter" do @@ -257,7 +257,7 @@ feature 'Tags' do expect(page).to have_css ".proposal", count: 2 expect(page).to have_content proposal1.title expect(page).to have_content proposal2.title - expect(page).to_not have_content proposal3.title + expect(page).not_to have_content proposal3.title end end @@ -296,7 +296,7 @@ feature 'Tags' do expect(page).to have_css ".proposal", count: 2 expect(page).to have_content proposal1.title expect(page).to have_content proposal2.title - expect(page).to_not have_content proposal3.title + expect(page).not_to have_content proposal3.title end end end diff --git a/spec/features/tags_spec.rb b/spec/features/tags_spec.rb index 8497d5b63..4aeec69df 100644 --- a/spec/features/tags_spec.rb +++ b/spec/features/tags_spec.rb @@ -30,8 +30,8 @@ feature 'Tags' do expect(page).to have_css('.debate', count: 2) expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) - expect(page).to_not have_content(debate4.title) + expect(page).not_to have_content(debate3.title) + expect(page).not_to have_content(debate4.title) end visit debates_path(search: 'salud') @@ -40,8 +40,8 @@ feature 'Tags' do expect(page).to have_css('.debate', count: 2) expect(page).to have_content(debate1.title) expect(page).to have_content(debate2.title) - expect(page).to_not have_content(debate3.title) - expect(page).to_not have_content(debate4.title) + expect(page).not_to have_content(debate3.title) + expect(page).not_to have_content(debate4.title) end end @@ -118,7 +118,7 @@ feature 'Tags' do click_button 'Save changes' expect(page).to have_content 'Debate updated successfully.' - expect(page).to_not have_content 'Economía' + expect(page).not_to have_content 'Economía' end context 'Tag cloud' do @@ -159,7 +159,7 @@ feature 'Tags' do within "#tag-cloud" do expect(page).to have_css(".tag", count: 1) expect(page).to have_content "Corrupción" - expect(page).to_not have_content "Economía" + expect(page).not_to have_content "Economía" end end @@ -175,7 +175,7 @@ feature 'Tags' do within "#tag-cloud" do expect(page).to have_css(".tag", count: 1) expect(page).to have_content "Playa" - expect(page).to_not have_content "Agua" + expect(page).not_to have_content "Agua" end end @@ -193,7 +193,7 @@ feature 'Tags' do expect(page).to have_css ".proposal", count: 2 expect(page).to have_content proposal1.title expect(page).to have_content proposal2.title - expect(page).to_not have_content proposal3.title + expect(page).not_to have_content proposal3.title end end diff --git a/spec/features/users_auth_spec.rb b/spec/features/users_auth_spec.rb index 69332e6e2..931a9638e 100644 --- a/spec/features/users_auth_spec.rb +++ b/spec/features/users_auth_spec.rb @@ -87,7 +87,7 @@ feature 'Users' do fill_in 'user_password', with: 'symbiote' click_button 'Enter' - expect(page).to_not have_content 'You have been signed in successfully.' + expect(page).not_to have_content 'You have been signed in successfully.' expect(page).to have_content 'Invalid login or password.' fill_in 'user_login', with: 'venom@nyc.dev' @@ -377,7 +377,7 @@ feature 'Users' do login_as(admin.user) visit root_path - expect(page).to_not have_content "Your password is expired" + expect(page).not_to have_content "Your password is expired" end scenario 'Sign in, user with password expired' do @@ -386,7 +386,7 @@ feature 'Users' do login_as(user) visit root_path - expect(page).to_not have_content "Your password is expired" + expect(page).not_to have_content "Your password is expired" end scenario 'Admin with password expired trying to use same password' do diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb index 0ca1f0266..14615379e 100644 --- a/spec/features/users_spec.rb +++ b/spec/features/users_spec.rb @@ -24,7 +24,7 @@ feature 'Users' do scenario 'shows only items where user has activity' do @user.proposals.destroy_all - expect(page).to_not have_content('0 Proposals') + expect(page).not_to have_content('0 Proposals') expect(page).to have_content('1 Debate') expect(page).to have_content('3 Investments') expect(page).to have_content('4 Comments') @@ -36,11 +36,11 @@ feature 'Users' do end @user.debates.each do |debate| - expect(page).to_not have_content(debate.title) + expect(page).not_to have_content(debate.title) end @user.comments.each do |comment| - expect(page).to_not have_content(comment.body) + expect(page).not_to have_content(comment.body) end end @@ -78,11 +78,11 @@ feature 'Users' do end @user.proposals.each do |proposal| - expect(page).to_not have_content(proposal.title) + expect(page).not_to have_content(proposal.title) end @user.comments.each do |comment| - expect(page).to_not have_content(comment.body) + expect(page).not_to have_content(comment.body) end click_link '4 Comments' @@ -92,11 +92,11 @@ feature 'Users' do end @user.proposals.each do |proposal| - expect(page).to_not have_content(proposal.title) + expect(page).not_to have_content(proposal.title) end @user.debates.each do |debate| - expect(page).to_not have_content(debate.title) + expect(page).not_to have_content(debate.title) end click_link '2 Proposals' @@ -106,11 +106,11 @@ feature 'Users' do end @user.comments.each do |comment| - expect(page).to_not have_content(comment.body) + expect(page).not_to have_content(comment.body) end @user.debates.each do |debate| - expect(page).to_not have_content(debate.title) + expect(page).not_to have_content(debate.title) end end @@ -125,7 +125,7 @@ feature 'Users' do visit user_path(@user) expect(page).to have_content(@user.username) - expect(page).to_not have_content('activity list private') + expect(page).not_to have_content('activity list private') end scenario 'user can hide public page' do @@ -149,7 +149,7 @@ feature 'Users' do click_button 'Save changes' visit user_path(@user) - expect(page).to_not have_content('activity list private') + expect(page).not_to have_content('activity list private') end scenario 'is always visible for admins' do @@ -163,7 +163,7 @@ feature 'Users' do login_as(create(:administrator).user) visit user_path(@user) - expect(page).to_not have_content('activity list private') + expect(page).not_to have_content('activity list private') end scenario 'is always visible for moderators' do @@ -177,7 +177,7 @@ feature 'Users' do login_as(create(:moderator).user) visit user_path(@user) - expect(page).to_not have_content('activity list private') + expect(page).not_to have_content('activity list private') end feature 'User email' do @@ -188,19 +188,19 @@ feature 'Users' do scenario 'is not shown if no user logged in' do visit user_path(@user) - expect(page).to_not have_content(@user.email) + expect(page).not_to have_content(@user.email) end scenario 'is not shown if logged in user is a regular user' do login_as(create(:user)) visit user_path(@user) - expect(page).to_not have_content(@user.email) + expect(page).not_to have_content(@user.email) end scenario 'is not shown if logged in user is moderator' do login_as(create(:moderator).user) visit user_path(@user) - expect(page).to_not have_content(@user.email) + expect(page).not_to have_content(@user.email) end scenario 'is shown if logged in user is admin' do @@ -355,7 +355,7 @@ feature 'Users' do visit user_path(moderator) expect(page).to have_content("1 Comment") expect(page).to have_content(comment.body) - expect(page).to_not have_content(moderator_comment.body) + expect(page).not_to have_content(moderator_comment.body) end scenario 'comments posted as admin are not visible in user activity' do @@ -365,7 +365,7 @@ feature 'Users' do visit user_path(admin) expect(page).to have_content(comment.body) - expect(page).to_not have_content(admin_comment.body) + expect(page).not_to have_content(admin_comment.body) end scenario 'shows only comments from active features' do diff --git a/spec/features/valuation/budget_investments_spec.rb b/spec/features/valuation/budget_investments_spec.rb index a627d9422..7bd955e0e 100644 --- a/spec/features/valuation/budget_investments_spec.rb +++ b/spec/features/valuation/budget_investments_spec.rb @@ -30,7 +30,7 @@ feature 'Valuation budget investments' do visit valuation_budget_budget_investments_path(@budget) expect(page).to have_content(investment1.title) - expect(page).to_not have_content(investment2.title) + expect(page).not_to have_content(investment2.title) end scenario 'Index shows no budget investment to admins no valuators' do @@ -43,8 +43,8 @@ feature 'Valuation budget investments' do login_as create(:administrator).user visit valuation_budget_budget_investments_path(@budget) - expect(page).to_not have_content(investment1.title) - expect(page).to_not have_content(investment2.title) + expect(page).not_to have_content(investment1.title) + expect(page).not_to have_content(investment2.title) end scenario 'Index orders budget investments by votes' do @@ -83,12 +83,12 @@ feature 'Valuation budget investments' do click_link "District 9", exact: false expect(page).to have_link("Realocate visitors") - expect(page).to_not have_link("Destroy the city") + expect(page).not_to have_link("Destroy the city") click_link "Down to the river", exact: false expect(page).to have_link("Destroy the city") - expect(page).to_not have_link("Realocate visitors") + expect(page).not_to have_link("Realocate visitors") click_link "All headings", exact: false expect(page).to have_link("Realocate visitors") @@ -101,13 +101,13 @@ feature 'Valuation budget investments' do visit valuation_budget_budget_investments_path(@budget) - expect(page).to_not have_link(filters_links.values.first) + expect(page).not_to have_link(filters_links.values.first) filters_links.keys.drop(1).each { |filter| expect(page).to have_link(filters_links[filter]) } filters_links.each_pair do |current_filter, link| visit valuation_budget_budget_investments_path(@budget, filter: current_filter) - expect(page).to_not have_link(link) + expect(page).not_to have_link(link) (filters_links.keys - [current_filter]).each do |filter| expect(page).to have_link(filters_links[filter]) @@ -124,16 +124,16 @@ feature 'Valuation budget investments' do visit valuation_budget_budget_investments_path(@budget) expect(page).to have_content("Ongoing valuation") - expect(page).to_not have_content("Old idea") + expect(page).not_to have_content("Old idea") visit valuation_budget_budget_investments_path(@budget, filter: 'valuating') expect(page).to have_content("Ongoing valuation") - expect(page).to_not have_content("Old idea") + expect(page).not_to have_content("Old idea") visit valuation_budget_budget_investments_path(@budget, filter: 'valuation_finished') - expect(page).to_not have_content("Ongoing valuation") + expect(page).not_to have_content("Ongoing valuation") expect(page).to have_content("Old idea") end @@ -234,8 +234,8 @@ feature 'Valuation budget investments' do within('#price_first_year') { expect(page).to have_content('Undefined') } within('#duration') { expect(page).to have_content('Undefined') } within('#feasibility') { expect(page).to have_content('Undecided') } - expect(page).to_not have_content('Valuation finished') - expect(page).to_not have_content('Internal comments') + expect(page).not_to have_content('Valuation finished') + expect(page).not_to have_content('Internal comments') end scenario 'Edit dossier' do @@ -262,7 +262,7 @@ feature 'Valuation budget investments' do expect(page).to have_content('Very cheap idea') within('#duration') { expect(page).to have_content('19 months') } within('#feasibility') { expect(page).to have_content('Feasible') } - expect(page).to_not have_content('Valuation finished') + expect(page).not_to have_content('Valuation finished') expect(page).to have_content('Internal comments') expect(page).to have_content('Should be double checked by the urbanism area') end @@ -277,7 +277,7 @@ feature 'Valuation budget investments' do visit edit_valuation_budget_budget_investment_path(@budget, @investment) - expect(find("#budget_investment_feasibility_undecided")).to_not be_checked + expect(find("#budget_investment_feasibility_undecided")).not_to be_checked expect(find("#budget_investment_feasibility_feasible")).to be_checked choose 'budget_investment_feasibility_undecided' @@ -304,7 +304,7 @@ feature 'Valuation budget investments' do choose 'budget_investment_feasibility_feasible' unfeasible_fields.each do |field| - expect(page).to_not have_content(field) + expect(page).not_to have_content(field) end (feasible_fields + any_feasibility_fields).each do |field| @@ -314,7 +314,7 @@ feature 'Valuation budget investments' do choose 'budget_investment_feasibility_unfeasible' feasible_fields.each do |field| - expect(page).to_not have_content(field) + expect(page).not_to have_content(field) end (unfeasible_fields + any_feasibility_fields).each do |field| @@ -327,7 +327,7 @@ feature 'Valuation budget investments' do expect(find("#budget_investment_feasibility_unfeasible")).to be_checked feasible_fields.each do |field| - expect(page).to_not have_content(field) + expect(page).not_to have_content(field) end (unfeasible_fields + any_feasibility_fields).each do |field| @@ -349,7 +349,7 @@ feature 'Valuation budget investments' do click_button 'Save changes' visit valuation_budget_budget_investments_path(@budget) - expect(page).to_not have_content @investment.title + expect(page).not_to have_content @investment.title click_link 'Valuation finished' expect(page).to have_content @investment.title diff --git a/spec/features/valuation/budgets_spec.rb b/spec/features/valuation/budgets_spec.rb index 303d6c087..ec3b780ab 100644 --- a/spec/features/valuation/budgets_spec.rb +++ b/spec/features/valuation/budgets_spec.rb @@ -35,7 +35,7 @@ feature 'Valuation budgets' do expect(page).to have_content(budget2.name) expect(page).to have_content(budget3.name) expect(page).to have_content(budget4.name) - expect(page).to_not have_content(budget5.name) + expect(page).not_to have_content(budget5.name) end end diff --git a/spec/features/valuation_spec.rb b/spec/features/valuation_spec.rb index 7a6a557a9..c004f0773 100644 --- a/spec/features/valuation_spec.rb +++ b/spec/features/valuation_spec.rb @@ -17,7 +17,7 @@ feature 'Valuation' do login_as(user) visit root_path - expect(page).to_not have_link("Valuation") + expect(page).not_to have_link("Valuation") visit valuation_root_path expect(page).not_to have_current_path(valuation_root_path) @@ -30,7 +30,7 @@ feature 'Valuation' do login_as(user) visit root_path - expect(page).to_not have_link("Valuation") + expect(page).not_to have_link("Valuation") visit valuation_root_path expect(page).not_to have_current_path(valuation_root_path) @@ -43,7 +43,7 @@ feature 'Valuation' do login_as(user) visit root_path - expect(page).to_not have_link("Valuation") + expect(page).not_to have_link("Valuation") visit valuation_root_path expect(page).not_to have_current_path(valuation_root_path) @@ -56,7 +56,7 @@ feature 'Valuation' do login_as(user) visit root_path - expect(page).to_not have_link("Valuation") + expect(page).not_to have_link("Valuation") visit valuation_root_path expect(page).not_to have_current_path(valuation_root_path) @@ -73,7 +73,7 @@ feature 'Valuation' do click_on "Valuation" expect(page).to have_current_path(valuation_root_path) - expect(page).to_not have_content "You do not have permission to access this page" + expect(page).not_to have_content "You do not have permission to access this page" end scenario 'Access as an administrator is authorized' do @@ -85,7 +85,7 @@ feature 'Valuation' do click_on "Valuation" expect(page).to have_current_path(valuation_root_path) - expect(page).to_not have_content "You do not have permission to access this page" + expect(page).not_to have_content "You do not have permission to access this page" end scenario "Valuation access links" do @@ -94,8 +94,8 @@ feature 'Valuation' do visit root_path expect(page).to have_link('Valuation') - expect(page).to_not have_link('Administration') - expect(page).to_not have_link('Moderation') + expect(page).not_to have_link('Administration') + expect(page).not_to have_link('Moderation') end scenario 'Valuation dashboard' do @@ -107,8 +107,8 @@ feature 'Valuation' do expect(page).to have_current_path(valuation_root_path) expect(page).to have_css('#valuation_menu') - expect(page).to_not have_css('#admin_menu') - expect(page).to_not have_css('#moderation_menu') + expect(page).not_to have_css('#admin_menu') + expect(page).not_to have_css('#moderation_menu') end end diff --git a/spec/features/verification/email_spec.rb b/spec/features/verification/email_spec.rb index bf1ff9b37..d29a56a80 100644 --- a/spec/features/verification/email_spec.rb +++ b/spec/features/verification/email_spec.rb @@ -29,7 +29,7 @@ feature 'Verify email' do expect(page).to have_content "You are a verified user" - expect(page).to_not have_link "Verify my account" + expect(page).not_to have_link "Verify my account" expect(page).to have_content "Account verified" end diff --git a/spec/features/verification/level_three_verification_spec.rb b/spec/features/verification/level_three_verification_spec.rb index ff88f8477..1e339307c 100644 --- a/spec/features/verification/level_three_verification_spec.rb +++ b/spec/features/verification/level_three_verification_spec.rb @@ -29,7 +29,7 @@ feature 'Level three verification' do expect(page).to have_content "Code correct. Your account is now verified" - expect(page).to_not have_link "Verify my account" + expect(page).not_to have_link "Verify my account" expect(page).to have_content "Account verified" end @@ -60,7 +60,7 @@ feature 'Level three verification' do expect(page).to have_content "You are a verified user" - expect(page).to_not have_link "Verify my account" + expect(page).not_to have_link "Verify my account" expect(page).to have_content "Account verified" end diff --git a/spec/features/votes_spec.rb b/spec/features/votes_spec.rb index add6f71c8..c837deebf 100644 --- a/spec/features/votes_spec.rb +++ b/spec/features/votes_spec.rb @@ -24,36 +24,36 @@ feature 'Votes' do within("#debate_#{debate1.id}_votes") do within(".in-favor") do expect(page).to have_css("a.voted") - expect(page).to_not have_css("a.no-voted") + expect(page).not_to have_css("a.no-voted") end within(".against") do expect(page).to have_css("a.no-voted") - expect(page).to_not have_css("a.voted") + expect(page).not_to have_css("a.voted") end end within("#debate_#{debate2.id}_votes") do within(".in-favor") do - expect(page).to_not have_css("a.voted") - expect(page).to_not have_css("a.no-voted") + expect(page).not_to have_css("a.voted") + expect(page).not_to have_css("a.no-voted") end within(".against") do - expect(page).to_not have_css("a.no-voted") - expect(page).to_not have_css("a.voted") + expect(page).not_to have_css("a.no-voted") + expect(page).not_to have_css("a.voted") end end within("#debate_#{debate3.id}_votes") do within(".in-favor") do expect(page).to have_css("a.no-voted") - expect(page).to_not have_css("a.voted") + expect(page).not_to have_css("a.voted") end within(".against") do expect(page).to have_css("a.voted") - expect(page).to_not have_css("a.no-voted") + expect(page).not_to have_css("a.no-voted") end end end @@ -68,14 +68,14 @@ feature 'Votes' do within('.in-favor') do expect(page).to have_content "0%" - expect(page).to_not have_css("a.voted") - expect(page).to_not have_css("a.no-voted") + expect(page).not_to have_css("a.voted") + expect(page).not_to have_css("a.no-voted") end within('.against') do expect(page).to have_content "0%" - expect(page).to_not have_css("a.voted") - expect(page).to_not have_css("a.no-voted") + expect(page).not_to have_css("a.voted") + expect(page).not_to have_css("a.no-voted") end end @@ -104,7 +104,7 @@ feature 'Votes' do find('.in-favor a').click expect(page).to have_content "1 vote" find('.in-favor a').click - expect(page).to_not have_content "2 votes" + expect(page).not_to have_content "2 votes" within('.in-favor') do expect(page).to have_content "100%" @@ -195,11 +195,11 @@ feature 'Votes' do end within("#proposal_#{proposal2.id}_votes") do - expect(page).to_not have_content "You have already supported this proposal. Share it!" + expect(page).not_to have_content "You have already supported this proposal. Share it!" end within("#proposal_#{proposal3.id}_votes") do - expect(page).to_not have_content "You have already supported this proposal. Share it!" + expect(page).not_to have_content "You have already supported this proposal. Share it!" end end end @@ -221,7 +221,7 @@ feature 'Votes' do find('.in-favor a').click expect(page).to have_content "1 support" - expect(page).to_not have_selector ".in-favor a" + expect(page).not_to have_selector ".in-favor a" end end @@ -389,11 +389,11 @@ feature 'Votes' do end within("#spending_proposal_#{spending_proposal2.id}_votes") do - expect(page).to_not have_content "You have already supported this. Share it!" + expect(page).not_to have_content "You have already supported this. Share it!" end within("#spending_proposal_#{spending_proposal3.id}_votes") do - expect(page).to_not have_content "You have already supported this. Share it!" + expect(page).not_to have_content "You have already supported this. Share it!" end end end @@ -428,7 +428,7 @@ feature 'Votes' do find('.in-favor a').click expect(page).to have_content "1 support" - expect(page).to_not have_selector ".in-favor a" + expect(page).not_to have_selector ".in-favor a" end end diff --git a/spec/lib/acts_as_paranoid_aliases_spec.rb b/spec/lib/acts_as_paranoid_aliases_spec.rb index b47be8cea..f7e3ce35f 100644 --- a/spec/lib/acts_as_paranoid_aliases_spec.rb +++ b/spec/lib/acts_as_paranoid_aliases_spec.rb @@ -40,7 +40,7 @@ describe 'Paranoid methods' do debate.restore - expect(debate.reload.confirmed_hide?).to_not be + expect(debate.reload.confirmed_hide?).not_to be end end diff --git a/spec/lib/acts_as_taggable_on_spec.rb b/spec/lib/acts_as_taggable_on_spec.rb index 4b9cb6756..934c312b8 100644 --- a/spec/lib/acts_as_taggable_on_spec.rb +++ b/spec/lib/acts_as_taggable_on_spec.rb @@ -97,7 +97,7 @@ describe ActsAsTaggableOn do it "blocks tags that don't have at least one tagged element" do tag = create(:tag) - expect(ActsAsTaggableOn::Tag.public_for_api).to_not include(tag) + expect(ActsAsTaggableOn::Tag.public_for_api).not_to include(tag) end it 'only permits tags on proposals or debates' do diff --git a/spec/lib/census_api_spec.rb b/spec/lib/census_api_spec.rb index 06fb2bc53..aebf2edfd 100644 --- a/spec/lib/census_api_spec.rb +++ b/spec/lib/census_api_spec.rb @@ -60,7 +60,7 @@ describe CensusApi do allow(api).to receive(:get_response_body).with(1, "0123456").and_return(invalid_body) response = api.call(1, "123456") - expect(response).to_not be_valid + expect(response).not_to be_valid end end diff --git a/spec/lib/email_digests_spec.rb b/spec/lib/email_digests_spec.rb index 12c1557fc..7992c3706 100644 --- a/spec/lib/email_digests_spec.rb +++ b/spec/lib/email_digests_spec.rb @@ -15,7 +15,7 @@ describe EmailDigest do email_digest = described_class.new(user1) expect(email_digest.notifications).to include(notification1) - expect(email_digest.notifications).to_not include(notification2) + expect(email_digest.notifications).not_to include(notification2) end it "returns only proposal notifications" do @@ -30,7 +30,7 @@ describe EmailDigest do email_digest = described_class.new(user) expect(email_digest.notifications).to include(notification1) - expect(email_digest.notifications).to_not include(notification2) + expect(email_digest.notifications).not_to include(notification2) end end @@ -54,13 +54,13 @@ describe EmailDigest do notification = create(:notification, notifiable: proposal_notification, user: user, emailed_at: Time.current) email_digest = described_class.new(user) - expect(email_digest.pending_notifications?).to_not be + expect(email_digest.pending_notifications?).not_to be end it "returns false when there are no notifications for a user" do user = create(:user) email_digest = described_class.new(user) - expect(email_digest.pending_notifications?).to_not be + expect(email_digest.pending_notifications?).not_to be end end @@ -107,9 +107,9 @@ describe EmailDigest do notification2 = create(:notification, notifiable: proposal_notification, user: user1) notification3 = create(:notification, notifiable: proposal_notification, user: user2) - expect(notification1.emailed_at).to_not be - expect(notification2.emailed_at).to_not be - expect(notification3.emailed_at).to_not be + expect(notification1.emailed_at).not_to be + expect(notification2.emailed_at).not_to be + expect(notification3.emailed_at).not_to be email_digest = described_class.new(user1) email_digest.mark_as_emailed @@ -119,7 +119,7 @@ describe EmailDigest do notification3.reload expect(notification1.emailed_at).to be expect(notification2.emailed_at).to be - expect(notification3.emailed_at).to_not be + expect(notification3.emailed_at).not_to be end it "resets the failed_email_digests_count flag" do diff --git a/spec/lib/graphql_spec.rb b/spec/lib/graphql_spec.rb index 477291423..b86e06085 100644 --- a/spec/lib/graphql_spec.rb +++ b/spec/lib/graphql_spec.rb @@ -387,7 +387,7 @@ describe 'Consul Schema' do response = execute('{ comments { edges { node { body } } } }') received_comments = extract_fields(response, 'comments', 'body') - expect(received_comments).to_not include(not_public_debate_comment.body) + expect(received_comments).not_to include(not_public_debate_comment.body) end it 'does not include comments of proposals that are not public' do @@ -398,7 +398,7 @@ describe 'Consul Schema' do response = execute('{ comments { edges { node { body } } } }') received_comments = extract_fields(response, 'comments', 'body') - expect(received_comments).to_not include(not_public_proposal_comment.body) + expect(received_comments).not_to include(not_public_proposal_comment.body) end it 'does not include comments of polls that are not public' do @@ -409,7 +409,7 @@ describe 'Consul Schema' do response = execute('{ comments { edges { node { body } } } }') received_comments = extract_fields(response, 'comments', 'body') - expect(received_comments).to_not include(not_public_poll_comment.body) + expect(received_comments).not_to include(not_public_poll_comment.body) end it 'only returns date and hour for created_at' do @@ -457,7 +457,7 @@ describe 'Consul Schema' do response = execute('{ proposal_notifications { edges { node { title } } } }') received_notifications = extract_fields(response, 'proposal_notifications', 'title') - expect(received_notifications).to_not include(not_public_proposal_notification.title) + expect(received_notifications).not_to include(not_public_proposal_notification.title) end it 'only returns date and hour for created_at' do @@ -563,7 +563,7 @@ describe 'Consul Schema' do response = execute('{ tags { edges { node { name } } } }') received_tags = extract_fields(response, 'tags', 'name') - expect(received_tags).to_not include('Health') + expect(received_tags).not_to include('Health') end end @@ -667,7 +667,7 @@ describe 'Consul Schema' do response = execute('{ votes { edges { node { votable_id } } } }') received_votables = extract_fields(response, 'votes', 'votable_id') - expect(received_votables).to_not include(not_public_debate.id) + expect(received_votables).not_to include(not_public_debate.id) end it 'does not include votes of a hidden proposals' do @@ -679,7 +679,7 @@ describe 'Consul Schema' do response = execute('{ votes { edges { node { votable_id } } } }') received_votables = extract_fields(response, 'votes', 'votable_id') - expect(received_votables).to_not include(not_public_proposal.id) + expect(received_votables).not_to include(not_public_proposal.id) end it 'does not include votes of a hidden comments' do @@ -691,7 +691,7 @@ describe 'Consul Schema' do response = execute('{ votes { edges { node { votable_id } } } }') received_votables = extract_fields(response, 'votes', 'votable_id') - expect(received_votables).to_not include(not_public_comment.id) + expect(received_votables).not_to include(not_public_comment.id) end it 'only returns date and hour for created_at' do diff --git a/spec/lib/local_census_spec.rb b/spec/lib/local_census_spec.rb index 58132a706..0f4286cd4 100644 --- a/spec/lib/local_census_spec.rb +++ b/spec/lib/local_census_spec.rb @@ -48,7 +48,7 @@ describe LocalCensus do allow(api).to receive(:get_record).with(1, "0123456").and_return(invalid_body) response = api.call(1, "123456") - expect(response).to_not be_valid + expect(response).not_to be_valid end end diff --git a/spec/lib/tasks/dev_seed_spec.rb b/spec/lib/tasks/dev_seed_spec.rb index 0606033c6..901a9f541 100644 --- a/spec/lib/tasks/dev_seed_spec.rb +++ b/spec/lib/tasks/dev_seed_spec.rb @@ -13,6 +13,6 @@ describe 'rake db:dev_seed' do end it 'seeds the database without errors' do - expect { run_rake_task }.to_not raise_error + expect { run_rake_task }.not_to raise_error end end diff --git a/spec/models/activity_spec.rb b/spec/models/activity_spec.rb index aad181c55..902320ec6 100644 --- a/spec/models/activity_spec.rb +++ b/spec/models/activity_spec.rb @@ -13,7 +13,7 @@ describe Activity do expect(build(:activity, action: "hide")).to be_valid expect(build(:activity, action: "block")).to be_valid expect(build(:activity, action: "restore")).to be_valid - expect(build(:activity, action: "dissapear")).to_not be_valid + expect(build(:activity, action: "dissapear")).not_to be_valid end describe "log" do diff --git a/spec/models/budget/ballot/line_spec.rb b/spec/models/budget/ballot/line_spec.rb index 401396569..8d3c66e75 100644 --- a/spec/models/budget/ballot/line_spec.rb +++ b/spec/models/budget/ballot/line_spec.rb @@ -21,7 +21,7 @@ describe Budget::Ballot::Line do describe 'Money' do it "is not valid if insufficient funds" do investment.update(price: heading.price + 1) - expect(ballot_line).to_not be_valid + expect(ballot_line).not_to be_valid end it "is valid if sufficient funds" do @@ -33,7 +33,7 @@ describe Budget::Ballot::Line do describe 'Selectibility' do it "is not valid if investment is unselected" do investment.update(selected: false) - expect(ballot_line).to_not be_valid + expect(ballot_line).not_to be_valid end it "is valid if investment is selected" do @@ -64,7 +64,7 @@ describe Budget::Ballot::Line do expect(ballot_lines_by_investment).to include ballot_line1 expect(ballot_lines_by_investment).to include ballot_line2 - expect(ballot_lines_by_investment).to_not include ballot_line3 + expect(ballot_lines_by_investment).not_to include ballot_line3 end end diff --git a/spec/models/budget/investment/milestone_spec.rb b/spec/models/budget/investment/milestone_spec.rb index b6bfe1a7c..b019e8a40 100644 --- a/spec/models/budget/investment/milestone_spec.rb +++ b/spec/models/budget/investment/milestone_spec.rb @@ -11,17 +11,17 @@ describe Budget::Investment::Milestone do it "is not valid without a title" do milestone.title = nil - expect(milestone).to_not be_valid + expect(milestone).not_to be_valid end it "is not valid without a description" do milestone.description = nil - expect(milestone).to_not be_valid + expect(milestone).not_to be_valid end it "is not valid without an investment" do milestone.investment_id = nil - expect(milestone).to_not be_valid + expect(milestone).not_to be_valid end end diff --git a/spec/models/budget/investment_spec.rb b/spec/models/budget/investment_spec.rb index 2472b8bda..a04134ce4 100644 --- a/spec/models/budget/investment_spec.rb +++ b/spec/models/budget/investment_spec.rb @@ -13,23 +13,23 @@ describe Budget::Investment do it "is not valid without an author" do investment.author = nil - expect(investment).to_not be_valid + expect(investment).not_to be_valid end describe "#title" do it "is not valid without a title" do investment.title = nil - expect(investment).to_not be_valid + expect(investment).not_to be_valid end it "is not valid when very short" do investment.title = "abc" - expect(investment).to_not be_valid + expect(investment).not_to be_valid end it "is not valid when very long" do investment.title = "a" * 81 - expect(investment).to_not be_valid + expect(investment).not_to be_valid end end @@ -78,7 +78,7 @@ describe Budget::Investment do investment.unfeasibility_explanation = "" investment.feasibility = "unfeasible" investment.valuation_finished = true - expect(investment).to_not be_valid + expect(investment).not_to be_valid end end @@ -101,7 +101,7 @@ describe Budget::Investment do investment.price = "" investment.feasibility = "feasible" investment.valuation_finished = true - expect(investment).to_not be_valid + expect(investment).not_to be_valid end end @@ -122,7 +122,7 @@ describe Budget::Investment do let(:investment) { create(:budget_investment) } it "sets the time when the unfeasible email was sent" do - expect(investment.unfeasible_email_sent_at).to_not be + expect(investment.unfeasible_email_sent_at).not_to be investment.send_unfeasible_email expect(investment.unfeasible_email_sent_at).to be end @@ -403,7 +403,7 @@ describe Budget::Investment do expect(results).to include investment1 expect(results).to include investment2 - expect(results).to_not include investment3 + expect(results).not_to include investment3 end it "returns unfeasible investments" do @@ -415,7 +415,7 @@ describe Budget::Investment do expect(results).to include investment1 expect(results).to include investment2 - expect(results).to_not include investment3 + expect(results).not_to include investment3 end it "returns selected investments" do @@ -429,7 +429,7 @@ describe Budget::Investment do expect(results).to include investment1 expect(results).to include investment2 - expect(results).to_not include investment3 + expect(results).not_to include investment3 end it "returns unselected investments" do @@ -443,7 +443,7 @@ describe Budget::Investment do expect(results).to include investment1 expect(results).to include investment2 - expect(results).to_not include investment3 + expect(results).not_to include investment3 end it "returns investmens by heading" do @@ -460,7 +460,7 @@ describe Budget::Investment do expect(results).to include investment1 expect(results).to include investment2 - expect(results).to_not include investment3 + expect(results).not_to include investment3 end it "returns investments by search string" do @@ -472,7 +472,7 @@ describe Budget::Investment do expect(results).to include investment1 expect(results).to include investment2 - expect(results).to_not include investment3 + expect(results).not_to include investment3 end end @@ -643,7 +643,7 @@ describe Budget::Investment do create(:vote, votable: inv1) expect(described_class.with_supports).to include(inv1) - expect(described_class.with_supports).to_not include(inv2) + expect(described_class.with_supports).not_to include(inv2) end end diff --git a/spec/models/budget/reclassified_vote_spec.rb b/spec/models/budget/reclassified_vote_spec.rb index 0eca91f2e..059b5595c 100644 --- a/spec/models/budget/reclassified_vote_spec.rb +++ b/spec/models/budget/reclassified_vote_spec.rb @@ -11,23 +11,23 @@ describe Budget::ReclassifiedVote do it "is not valid without a user" do reclassified_vote.user_id = nil - expect(reclassified_vote).to_not be_valid + expect(reclassified_vote).not_to be_valid end it "is not valid without an investment" do reclassified_vote.investment_id = nil - expect(reclassified_vote).to_not be_valid + expect(reclassified_vote).not_to be_valid end it "is not valid without a valid reason" do reclassified_vote.reason = nil - expect(reclassified_vote).to_not be_valid + expect(reclassified_vote).not_to be_valid reclassified_vote.reason = "" - expect(reclassified_vote).to_not be_valid + expect(reclassified_vote).not_to be_valid reclassified_vote.reason = "random" - expect(reclassified_vote).to_not be_valid + expect(reclassified_vote).not_to be_valid reclassified_vote.reason = "heading_changed" expect(reclassified_vote).to be_valid diff --git a/spec/models/budget_spec.rb b/spec/models/budget_spec.rb index 7b80d7a67..b7926eb7b 100644 --- a/spec/models/budget_spec.rb +++ b/spec/models/budget_spec.rb @@ -36,7 +36,7 @@ describe Budget do end budget.phase = 'inexisting' - expect(budget).to_not be_valid + expect(budget).not_to be_valid end it "produces auxiliary methods" do @@ -64,39 +64,39 @@ describe Budget do it "on_hold?" do budget.phase = "accepting" - expect(budget).to_not be_on_hold + expect(budget).not_to be_on_hold budget.phase = "reviewing" expect(budget).to be_on_hold budget.phase = "selecting" - expect(budget).to_not be_on_hold + expect(budget).not_to be_on_hold budget.phase = "valuating" expect(budget).to be_on_hold budget.phase = "balloting" - expect(budget).to_not be_on_hold + expect(budget).not_to be_on_hold budget.phase = "reviewing_ballots" expect(budget).to be_on_hold budget.phase = "finished" - expect(budget).to_not be_on_hold + expect(budget).not_to be_on_hold end it "balloting_or_later?" do budget.phase = "accepting" - expect(budget).to_not be_balloting_or_later + expect(budget).not_to be_balloting_or_later budget.phase = "reviewing" - expect(budget).to_not be_balloting_or_later + expect(budget).not_to be_balloting_or_later budget.phase = "selecting" - expect(budget).to_not be_balloting_or_later + expect(budget).not_to be_balloting_or_later budget.phase = "valuating" - expect(budget).to_not be_balloting_or_later + expect(budget).not_to be_balloting_or_later budget.phase = "balloting" expect(budget).to be_balloting_or_later diff --git a/spec/models/comment_spec.rb b/spec/models/comment_spec.rb index ae772fa3f..fb55c6a81 100644 --- a/spec/models/comment_spec.rb +++ b/spec/models/comment_spec.rb @@ -185,7 +185,7 @@ describe Comment do it 'does not return comments with no commentable' do comment = build(:comment, commentable: nil).save!(validate: false) - expect(described_class.public_for_api).to_not include(comment) + expect(described_class.public_for_api).not_to include(comment) end end end diff --git a/spec/models/debate_spec.rb b/spec/models/debate_spec.rb index 88e5383da..6f9104fa8 100644 --- a/spec/models/debate_spec.rb +++ b/spec/models/debate_spec.rb @@ -15,30 +15,30 @@ describe Debate do it "is not valid without an author" do debate.author = nil - expect(debate).to_not be_valid + expect(debate).not_to be_valid end describe "#title" do it "is not valid without a title" do debate.title = nil - expect(debate).to_not be_valid + expect(debate).not_to be_valid end it "is not valid when very short" do debate.title = "abc" - expect(debate).to_not be_valid + expect(debate).not_to be_valid end it "is not valid when very long" do debate.title = "a" * 81 - expect(debate).to_not be_valid + expect(debate).not_to be_valid end end describe "#description" do it "is not valid without a description" do debate.description = nil - expect(debate).to_not be_valid + expect(debate).not_to be_valid end it "is sanitized" do @@ -54,12 +54,12 @@ describe Debate do it "is not valid when very short" do debate.description = "abc" - expect(debate).to_not be_valid + expect(debate).not_to be_valid end it "is not valid when very long" do debate.description = "a" * 6001 - expect(debate).to_not be_valid + expect(debate).not_to be_valid end end @@ -72,7 +72,7 @@ describe Debate do it "is not valid with a tag list of more than 6 elements" do debate.tag_list = ["Hacienda", "Economía", "Medio Ambiente", "Corrupción", "Fiestas populares", "Prensa", "Huelgas"] - expect(debate).to_not be_valid + expect(debate).not_to be_valid end it "is valid with a tag list of 6 elements" do @@ -83,7 +83,7 @@ describe Debate do it "is not valid without accepting terms of service" do debate.terms_of_service = nil - expect(debate).to_not be_valid + expect(debate).not_to be_valid end describe "#editable?" do @@ -181,7 +181,7 @@ describe Debate do it "does not increase anonymous votes counter " do user = create(:user, residence_verified_at: Time.current, confirmed_phone: "666333111") - expect {debate.register_vote(user, 'yes')}.to_not change{debate.reload.cached_anonymous_votes_total} + expect {debate.register_vote(user, 'yes')}.not_to change{debate.reload.cached_anonymous_votes_total} end end @@ -193,7 +193,7 @@ describe Debate do it "does not increase anonymous votes counter " do user = create(:user, verified_at: Time.current) - expect {debate.register_vote(user, 'yes')}.to_not change{debate.reload.cached_anonymous_votes_total} + expect {debate.register_vote(user, 'yes')}.not_to change{debate.reload.cached_anonymous_votes_total} end end @@ -216,12 +216,12 @@ describe Debate do it "does not register vote " do user = create(:user) - expect {debate.register_vote(user, 'yes')}.to_not change {debate.reload.votes_for.size} + expect {debate.register_vote(user, 'yes')}.not_to change {debate.reload.votes_for.size} end it "does not increase anonymous votes counter " do user = create(:user) - expect {debate.register_vote(user, 'yes')}.to_not change {debate.reload.cached_anonymous_votes_total} + expect {debate.register_vote(user, 'yes')}.not_to change {debate.reload.cached_anonymous_votes_total} end end end @@ -418,25 +418,25 @@ describe Debate do it "returns false when it has less than or equal to 1 flag for 5 positive votes" do debate.update(cached_votes_up: 5) debate.update(flags_count: 1) - expect(debate).to_not be_conflictive + expect(debate).not_to be_conflictive debate.update(cached_votes_up: 10) debate.update(flags_count: 2) - expect(debate).to_not be_conflictive + expect(debate).not_to be_conflictive debate.update(cached_votes_up: 100) debate.update(flags_count: 2) - expect(debate).to_not be_conflictive + expect(debate).not_to be_conflictive end it "returns false when it has no flags" do debate.update(flags_count: 0) - expect(debate).to_not be_conflictive + expect(debate).not_to be_conflictive end it "returns false when it has not votes up" do debate.update(cached_votes_up: 0) - expect(debate).to_not be_conflictive + expect(debate).not_to be_conflictive end end @@ -697,7 +697,7 @@ describe Debate do it "does not show debates created more than a week ago" do debate = create(:debate, created_at: 8.days.ago) - expect(described_class.last_week.all).to_not include debate + expect(described_class.last_week.all).not_to include debate end end @@ -715,7 +715,7 @@ describe Debate do it 'does not return hidden debates' do debate = create(:debate, :hidden) - expect(described_class.public_for_api).to_not include(debate) + expect(described_class.public_for_api).not_to include(debate) end end diff --git a/spec/models/direct_message_spec.rb b/spec/models/direct_message_spec.rb index 6e97e6958..4cb3d1c45 100644 --- a/spec/models/direct_message_spec.rb +++ b/spec/models/direct_message_spec.rb @@ -10,22 +10,22 @@ describe DirectMessage do it "is not valid without a title" do direct_message.title = nil - expect(direct_message).to_not be_valid + expect(direct_message).not_to be_valid end it "is not valid without a body" do direct_message.body = nil - expect(direct_message).to_not be_valid + expect(direct_message).not_to be_valid end it "is not valid without an associated sender" do direct_message.sender = nil - expect(direct_message).to_not be_valid + expect(direct_message).not_to be_valid end it "is not valid without an associated receiver" do direct_message.receiver = nil - expect(direct_message).to_not be_valid + expect(direct_message).not_to be_valid end describe "maximum number of direct messages per day" do @@ -41,7 +41,7 @@ describe DirectMessage do direct_message3 = create(:direct_message, sender: sender) direct_message4 = build(:direct_message, sender: sender) - expect(direct_message4).to_not be_valid + expect(direct_message4).not_to be_valid end it "is valid if below maximum" do diff --git a/spec/models/flag_spec.rb b/spec/models/flag_spec.rb index 43d6a6a46..50caf8d46 100644 --- a/spec/models/flag_spec.rb +++ b/spec/models/flag_spec.rb @@ -44,7 +44,7 @@ describe Flag do describe '.flagged?' do it 'returns false when the user has not flagged the comment' do - expect(described_class.flagged?(user, comment)).to_not be + expect(described_class.flagged?(user, comment)).not_to be end it 'returns true when the user has flagged the comment' do diff --git a/spec/models/follow_spec.rb b/spec/models/follow_spec.rb index 5f7874267..d2014fed3 100644 --- a/spec/models/follow_spec.rb +++ b/spec/models/follow_spec.rb @@ -10,17 +10,17 @@ describe Follow do it "is not valid without a user_id" do follow.user_id = nil - expect(follow).to_not be_valid + expect(follow).not_to be_valid end it "is not valid without a followable_id" do follow.followable_id = nil - expect(follow).to_not be_valid + expect(follow).not_to be_valid end it "is not valid without a followable_type" do follow.followable_type = nil - expect(follow).to_not be_valid + expect(follow).not_to be_valid end end diff --git a/spec/models/geozone_spec.rb b/spec/models/geozone_spec.rb index 674cb2181..69c423f7a 100644 --- a/spec/models/geozone_spec.rb +++ b/spec/models/geozone_spec.rb @@ -9,7 +9,7 @@ describe Geozone do it "is not valid without a name" do geozone.name = nil - expect(geozone).to_not be_valid + expect(geozone).not_to be_valid end describe "#safe_to_destroy?" do diff --git a/spec/models/legislation/process_spec.rb b/spec/models/legislation/process_spec.rb index f3f1616b8..aef705d33 100644 --- a/spec/models/legislation/process_spec.rb +++ b/spec/models/legislation/process_spec.rb @@ -79,24 +79,24 @@ describe Legislation::Process do open_processes = ::Legislation::Process.open expect(open_processes).to include(@process_1) - expect(open_processes).to_not include(@process_2) - expect(open_processes).to_not include(@process_3) + expect(open_processes).not_to include(@process_2) + expect(open_processes).not_to include(@process_3) end it "filters next" do next_processes = ::Legislation::Process.next expect(next_processes).to include(@process_2) - expect(next_processes).to_not include(@process_1) - expect(next_processes).to_not include(@process_3) + expect(next_processes).not_to include(@process_1) + expect(next_processes).not_to include(@process_3) end it "filters past" do past_processes = ::Legislation::Process.past expect(past_processes).to include(@process_3) - expect(past_processes).to_not include(@process_2) - expect(past_processes).to_not include(@process_1) + expect(past_processes).not_to include(@process_2) + expect(past_processes).not_to include(@process_1) end end diff --git a/spec/models/legislation/proposal_spec.rb b/spec/models/legislation/proposal_spec.rb index 892164e17..4606acabc 100644 --- a/spec/models/legislation/proposal_spec.rb +++ b/spec/models/legislation/proposal_spec.rb @@ -9,22 +9,22 @@ describe Legislation::Proposal do it "is not valid without a process" do proposal.process = nil - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is not valid without an author" do proposal.author = nil - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is not valid without a title" do proposal.title = nil - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is not valid without a summary" do proposal.summary = nil - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end end diff --git a/spec/models/legislation/question_option_spec.rb b/spec/models/legislation/question_option_spec.rb index 0b635cfe9..1fd7eb307 100644 --- a/spec/models/legislation/question_option_spec.rb +++ b/spec/models/legislation/question_option_spec.rb @@ -13,6 +13,6 @@ RSpec.describe Legislation::QuestionOption, type: :model do invalid_question_option = build(:legislation_question_option, question: question, value: "uno") - expect(invalid_question_option).to_not be_valid + expect(invalid_question_option).not_to be_valid end end diff --git a/spec/models/officing/residence_spec.rb b/spec/models/officing/residence_spec.rb index daff43ce1..dca6b7a59 100644 --- a/spec/models/officing/residence_spec.rb +++ b/spec/models/officing/residence_spec.rb @@ -13,23 +13,23 @@ describe Officing::Residence do it "is not valid without a document number" do residence.document_number = nil - expect(residence).to_not be_valid + expect(residence).not_to be_valid end it "is not valid without a document type" do residence.document_type = nil - expect(residence).to_not be_valid + expect(residence).not_to be_valid end it "is not valid without a year of birth" do residence.year_of_birth = nil - expect(residence).to_not be_valid + expect(residence).not_to be_valid end describe "allowed age" do it "is not valid if user is under allowed age" do allow_any_instance_of(described_class).to receive(:date_of_birth).and_return(15.years.ago) - expect(residence).to_not be_valid + expect(residence).not_to be_valid expect(residence.errors[:year_of_birth]).to include("You don't have the required age to participate") end diff --git a/spec/models/poll/answer_spec.rb b/spec/models/poll/answer_spec.rb index 0582efd86..9211046c9 100644 --- a/spec/models/poll/answer_spec.rb +++ b/spec/models/poll/answer_spec.rb @@ -12,17 +12,17 @@ describe Poll::Answer do it "is not valid wihout a question" do answer.question = nil - expect(answer).to_not be_valid + expect(answer).not_to be_valid end it "is not valid without an author" do answer.author = nil - expect(answer).to_not be_valid + expect(answer).not_to be_valid end it "is not valid without an answer" do answer.answer = nil - expect(answer).to_not be_valid + expect(answer).not_to be_valid end it "is valid for answers included in the Poll::Question's question_answers list" do @@ -35,7 +35,7 @@ describe Poll::Answer do expect(build(:poll_answer, question: question, answer: 'Two')).to be_valid expect(build(:poll_answer, question: question, answer: 'Three')).to be_valid - expect(build(:poll_answer, question: question, answer: 'Four')).to_not be_valid + expect(build(:poll_answer, question: question, answer: 'Four')).not_to be_valid end end diff --git a/spec/models/poll/booth_spec.rb b/spec/models/poll/booth_spec.rb index 652e1060c..e4fccdbb9 100644 --- a/spec/models/poll/booth_spec.rb +++ b/spec/models/poll/booth_spec.rb @@ -10,7 +10,7 @@ describe Poll::Booth do it "is not valid without a name" do booth.name = nil - expect(booth).to_not be_valid + expect(booth).not_to be_valid end describe "#search" do @@ -41,7 +41,7 @@ describe Poll::Booth do expect(described_class.available).to include(booth_for_current_poll) expect(described_class.available).to include(booth_for_incoming_poll) - expect(described_class.available).to_not include(booth_for_expired_poll) + expect(described_class.available).not_to include(booth_for_expired_poll) end end diff --git a/spec/models/poll/partial_result_spec.rb b/spec/models/poll/partial_result_spec.rb index 7fa1e5e4a..4d72fa986 100644 --- a/spec/models/poll/partial_result_spec.rb +++ b/spec/models/poll/partial_result_spec.rb @@ -13,7 +13,7 @@ describe Poll::PartialResult do expect(build(:poll_partial_result, question: question, answer: 'Two')).to be_valid expect(build(:poll_partial_result, question: question, answer: 'Three')).to be_valid - expect(build(:poll_partial_result, question: question, answer: 'Four')).to_not be_valid + expect(build(:poll_partial_result, question: question, answer: 'Four')).not_to be_valid end end diff --git a/spec/models/poll/poll_spec.rb b/spec/models/poll/poll_spec.rb index d97c3805a..d9ebaa4cd 100644 --- a/spec/models/poll/poll_spec.rb +++ b/spec/models/poll/poll_spec.rb @@ -15,30 +15,30 @@ describe Poll do it "is not valid without a name" do poll.name = nil - expect(poll).to_not be_valid + expect(poll).not_to be_valid end it "is not valid without a start date" do poll.starts_at = nil - expect(poll).to_not be_valid + expect(poll).not_to be_valid end it "is not valid without an end date" do poll.ends_at = nil - expect(poll).to_not be_valid + expect(poll).not_to be_valid end it "is not valid without a proper start/end date range" do poll.starts_at = 1.week.ago poll.ends_at = 2.months.ago - expect(poll).to_not be_valid + expect(poll).not_to be_valid end end describe "#opened?" do it "returns true only when it isn't too early or too late" do - expect(create(:poll, :incoming)).to_not be_current - expect(create(:poll, :expired)).to_not be_current + expect(create(:poll, :incoming)).not_to be_current + expect(create(:poll, :expired)).not_to be_current expect(create(:poll)).to be_current end end @@ -46,22 +46,22 @@ describe Poll do describe "#incoming?" do it "returns true only when it is too early" do expect(create(:poll, :incoming)).to be_incoming - expect(create(:poll, :expired)).to_not be_incoming - expect(create(:poll)).to_not be_incoming + expect(create(:poll, :expired)).not_to be_incoming + expect(create(:poll)).not_to be_incoming end end describe "#expired?" do it "returns true only when it is too late" do - expect(create(:poll, :incoming)).to_not be_expired + expect(create(:poll, :incoming)).not_to be_expired expect(create(:poll, :expired)).to be_expired - expect(create(:poll)).to_not be_expired + expect(create(:poll)).not_to be_expired end end describe "#published?" do it "returns true only when published is true" do - expect(create(:poll)).to_not be_published + expect(create(:poll)).not_to be_published expect(create(:poll, :published)).to be_published end end @@ -76,7 +76,7 @@ describe Poll do expect(current_or_incoming).to include(current) expect(current_or_incoming).to include(incoming) - expect(current_or_incoming).to_not include(expired) + expect(current_or_incoming).not_to include(expired) end end @@ -89,9 +89,9 @@ describe Poll do recounting_polls = described_class.recounting - expect(recounting_polls).to_not include(current) - expect(recounting_polls).to_not include(incoming) - expect(recounting_polls).to_not include(expired) + expect(recounting_polls).not_to include(current) + expect(recounting_polls).not_to include(incoming) + expect(recounting_polls).not_to include(expired) expect(recounting_polls).to include(recounting) end end @@ -108,7 +108,7 @@ describe Poll do expect(current_or_recounting_or_incoming).to include(current) expect(current_or_recounting_or_incoming).to include(recounting) expect(current_or_recounting_or_incoming).to include(incoming) - expect(current_or_recounting_or_incoming).to_not include(expired) + expect(current_or_recounting_or_incoming).not_to include(expired) end end @@ -133,15 +133,15 @@ describe Poll do describe 'instance method' do it "rejects non-users and level 1 users" do all_polls.each do |poll| - expect(poll).to_not be_answerable_by(non_user) - expect(poll).to_not be_answerable_by(level1) + expect(poll).not_to be_answerable_by(non_user) + expect(poll).not_to be_answerable_by(level1) end end it "rejects everyone when not current" do non_current_polls.each do |poll| all_users.each do |user| - expect(poll).to_not be_answerable_by(user) + expect(poll).not_to be_answerable_by(user) end end end @@ -152,7 +152,7 @@ describe Poll do end it "accepts level 2 users only from the same geozone when restricted by geozone" do - expect(current_restricted_poll).to_not be_answerable_by(level2) + expect(current_restricted_poll).not_to be_answerable_by(level2) expect(current_restricted_poll).to be_answerable_by(level2_from_geozone) end end @@ -190,7 +190,7 @@ describe Poll do user = create(:user, :level_two) poll = create(:poll) - expect(poll.voted_in_booth?(user)).to_not be + expect(poll.voted_in_booth?(user)).not_to be end it "returns false if the user has voted in web" do @@ -199,7 +199,7 @@ describe Poll do create(:poll_voter, poll: poll, user: user, origin: "web") - expect(poll.voted_in_booth?(user)).to_not be + expect(poll.voted_in_booth?(user)).not_to be end end diff --git a/spec/models/poll/question_spec.rb b/spec/models/poll/question_spec.rb index 43f2de7a9..c43cedace 100644 --- a/spec/models/poll/question_spec.rb +++ b/spec/models/poll/question_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Poll::Question, type: :model do describe "#poll_question_id" do it "is invalid if a poll is not selected" do poll_question.poll_id = nil - expect(poll_question).to_not be_valid + expect(poll_question).not_to be_valid end it "is valid if a poll is selected" do diff --git a/spec/models/poll/shift_spec.rb b/spec/models/poll/shift_spec.rb index bb1146baa..a4aa5451c 100644 --- a/spec/models/poll/shift_spec.rb +++ b/spec/models/poll/shift_spec.rb @@ -16,28 +16,28 @@ describe Poll::Shift do it "is not valid without a booth" do shift.booth = nil - expect(shift).to_not be_valid + expect(shift).not_to be_valid end it "is not valid without an officer" do shift.officer = nil - expect(shift).to_not be_valid + expect(shift).not_to be_valid end it "is not valid without a date" do shift.date = nil - expect(shift).to_not be_valid + expect(shift).not_to be_valid end it "is not valid without a task" do shift.task = nil - expect(shift).to_not be_valid + expect(shift).not_to be_valid end it "is not valid with same booth, officer, date and task" do recount_shift.save - expect(build(:poll_shift, booth: booth, officer: officer, date: Date.current, task: :recount_scrutiny)).to_not be_valid + expect(build(:poll_shift, booth: booth, officer: officer, date: Date.current, task: :recount_scrutiny)).not_to be_valid end it "is valid with same booth, officer and date but different task" do diff --git a/spec/models/poll/voter_spec.rb b/spec/models/poll/voter_spec.rb index df28383bb..a82aece1f 100644 --- a/spec/models/poll/voter_spec.rb +++ b/spec/models/poll/voter_spec.rb @@ -15,12 +15,12 @@ describe Poll::Voter do it "is not valid without a user" do voter.user = nil - expect(voter).to_not be_valid + expect(voter).not_to be_valid end it "is not valid without a poll" do voter.poll = nil - expect(voter).to_not be_valid + expect(voter).not_to be_valid end it "is valid if has not voted" do @@ -35,7 +35,7 @@ describe Poll::Voter do voter1 = create(:poll_voter, user: user, poll: poll) voter2 = build(:poll_voter, user: user, poll: poll) - expect(voter2).to_not be_valid + expect(voter2).not_to be_valid expect(voter2.errors.messages[:document_number]).to eq(["User has already voted"]) end @@ -45,7 +45,7 @@ describe Poll::Voter do voter1 = create(:poll_voter, user: user, poll: poll, booth_assignment: booth_assignment) voter2 = build(:poll_voter, user: user, poll: poll, booth_assignment: booth_assignment) - expect(voter2).to_not be_valid + expect(voter2).not_to be_valid expect(voter2.errors.messages[:document_number]).to eq(["User has already voted"]) end @@ -58,7 +58,7 @@ describe Poll::Voter do voter1 = create(:poll_voter, user: user, poll: poll, booth_assignment: booth_assignment1) voter2 = build(:poll_voter, user: user, poll: poll, booth_assignment: booth_assignment2) - expect(voter2).to_not be_valid + expect(voter2).not_to be_valid expect(voter2.errors.messages[:document_number]).to eq(["User has already voted"]) end @@ -79,7 +79,7 @@ describe Poll::Voter do answer.record_voter_participation('token') voter = build(:poll_voter, poll: answer.question.poll, user: answer.author) - expect(voter).to_not be_valid + expect(voter).not_to be_valid expect(voter.errors.messages[:document_number]).to eq(["User has already voted"]) end @@ -87,12 +87,12 @@ describe Poll::Voter do it "is not valid without an origin" do voter.origin = nil - expect(voter).to_not be_valid + expect(voter).not_to be_valid end it "is not valid without a valid origin" do voter.origin = "invalid_origin" - expect(voter).to_not be_valid + expect(voter).not_to be_valid end it "is valid with a booth origin" do @@ -122,7 +122,7 @@ describe Poll::Voter do expect(web_voters.count).to eq(2) expect(web_voters).to include(voter1) expect(web_voters).to include(voter2) - expect(web_voters).to_not include(voter3) + expect(web_voters).not_to include(voter3) end end @@ -137,7 +137,7 @@ describe Poll::Voter do expect(booth_voters.count).to eq(2) expect(booth_voters).to include(voter1) expect(booth_voters).to include(voter2) - expect(booth_voters).to_not include(voter3) + expect(booth_voters).not_to include(voter3) end end diff --git a/spec/models/proposal_notification_spec.rb b/spec/models/proposal_notification_spec.rb index 884e87cd6..60021d95c 100644 --- a/spec/models/proposal_notification_spec.rb +++ b/spec/models/proposal_notification_spec.rb @@ -9,17 +9,17 @@ describe ProposalNotification do it "is not valid without a title" do notification.title = nil - expect(notification).to_not be_valid + expect(notification).not_to be_valid end it "is not valid without a body" do notification.body = nil - expect(notification).to_not be_valid + expect(notification).not_to be_valid end it "is not valid without an associated proposal" do notification.proposal = nil - expect(notification).to_not be_valid + expect(notification).not_to be_valid end describe "public_for_api scope" do @@ -57,7 +57,7 @@ describe ProposalNotification do notification2 = build(:proposal_notification, proposal: proposal) proposal.reload - expect(notification2).to_not be_valid + expect(notification2).not_to be_valid end it "is valid if notifications above minium interval" do diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index 6ddbcd117..28c620d36 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -16,28 +16,28 @@ describe Proposal do it "is not valid without an author" do proposal.author = nil - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is not valid without a summary" do proposal.summary = nil - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end describe "#title" do it "is not valid without a title" do proposal.title = nil - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is not valid when very short" do proposal.title = "abc" - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is not valid when very long" do proposal.title = "a" * 81 - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end end @@ -50,31 +50,31 @@ describe Proposal do it "is not valid when very long" do proposal.description = "a" * 6001 - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end end describe "#question" do it "is not valid without a question" do proposal.question = nil - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is not valid when very short" do proposal.question = "abc" - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is not valid when very long" do proposal.question = "a" * 141 - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end end describe "#video_url" do it "is not valid when URL is not from Youtube or Vimeo" do proposal.video_url = "https://twitter.com" - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is valid when URL is from Youtube or Vimeo" do @@ -86,17 +86,17 @@ describe Proposal do describe "#responsible_name" do it "is mandatory" do proposal.responsible_name = nil - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is not valid when very short" do proposal.responsible_name = "abc" - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is not valid when very long" do proposal.responsible_name = "a" * 61 - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is the document_number if level two user" do @@ -138,7 +138,7 @@ describe Proposal do it "is not valid with a tag list of more than 6 elements" do proposal.tag_list = ["Hacienda", "Economía", "Medio Ambiente", "Corrupción", "Fiestas populares", "Prensa", "Huelgas"] - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "is valid with a tag list of up to 6 elements" do @@ -149,7 +149,7 @@ describe Proposal do it "is not valid without accepting terms of service" do proposal.terms_of_service = nil - expect(proposal).to_not be_valid + expect(proposal).not_to be_valid end it "has a code" do @@ -409,7 +409,7 @@ describe Proposal do expect(proposal.voters).to include(voter1) expect(proposal.voters).to include(voter2) - expect(proposal.voters).to_not include(voter3) + expect(proposal.voters).not_to include(voter3) end it "does not return users that have been erased" do @@ -422,7 +422,7 @@ describe Proposal do voter2.erase expect(proposal.voters).to include(voter1) - expect(proposal.voters).to_not include(voter2) + expect(proposal.voters).not_to include(voter2) end it "does not return users that have been blocked" do @@ -435,7 +435,7 @@ describe Proposal do voter2.block expect(proposal.voters).to include(voter1) - expect(proposal.voters).to_not include(voter2) + expect(proposal.voters).not_to include(voter2) end end @@ -711,7 +711,7 @@ describe Proposal do it "does not return proposals created more than a week ago" do proposal = create(:proposal, created_at: 8.days.ago) - expect(described_class.last_week).to_not include(proposal) + expect(described_class.last_week).not_to include(proposal) end end @@ -730,7 +730,7 @@ describe Proposal do create(:tag, :category, name: 'culture') proposal = create(:proposal, tag_list: 'parks') - expect(described_class.for_summary.values.flatten).to_not include(proposal) + expect(described_class.for_summary.values.flatten).not_to include(proposal) end end @@ -747,7 +747,7 @@ describe Proposal do create(:geozone, name: 'california') proposal = create(:proposal) - expect(described_class.for_summary.values.flatten).to_not include(proposal) + expect(described_class.for_summary.values.flatten).not_to include(proposal) end end @@ -760,7 +760,7 @@ describe Proposal do it "does not return proposals created more than a week ago" do create(:tag, :category, name: 'culture') proposal = create(:proposal, tag_list: 'culture', created_at: 8.days.ago) - expect(described_class.for_summary.values.flatten).to_not include(proposal) + expect(described_class.for_summary.values.flatten).not_to include(proposal) end it "orders proposals by votes" do @@ -870,7 +870,7 @@ describe Proposal do it 'does not return hidden proposals' do proposal = create(:proposal, :hidden) - expect(described_class.public_for_api).to_not include(proposal) + expect(described_class.public_for_api).not_to include(proposal) end end diff --git a/spec/models/signature_sheet_spec.rb b/spec/models/signature_sheet_spec.rb index 29eb790c6..e573d8259 100644 --- a/spec/models/signature_sheet_spec.rb +++ b/spec/models/signature_sheet_spec.rb @@ -20,22 +20,22 @@ describe SignatureSheet do it "is not valid without signable" do signature_sheet.signable = nil - expect(signature_sheet).to_not be_valid + expect(signature_sheet).not_to be_valid end it "is not valid without a valid signable" do signature_sheet.signable = create(:comment) - expect(signature_sheet).to_not be_valid + expect(signature_sheet).not_to be_valid end it "is not valid without document numbers" do signature_sheet.document_numbers = nil - expect(signature_sheet).to_not be_valid + expect(signature_sheet).not_to be_valid end it "is not valid without an author" do signature_sheet.author = nil - expect(signature_sheet).to_not be_valid + expect(signature_sheet).not_to be_valid end end diff --git a/spec/models/signature_spec.rb b/spec/models/signature_spec.rb index 5133af6fe..6a27fc029 100644 --- a/spec/models/signature_spec.rb +++ b/spec/models/signature_spec.rb @@ -12,18 +12,18 @@ describe Signature do it "is not valid without a document number" do signature.document_number = nil - expect(signature).to_not be_valid + expect(signature).not_to be_valid signature.document_number = "" - expect(signature).to_not be_valid + expect(signature).not_to be_valid signature.document_number = " " - expect(signature).to_not be_valid + expect(signature).not_to be_valid end it "is not valid without an associated signature sheet" do signature.signature_sheet = nil - expect(signature).to_not be_valid + expect(signature).not_to be_valid end end @@ -89,7 +89,7 @@ describe Signature do signature.verify - expect(user.voted_for?(investment)).to_not be + expect(user.voted_for?(investment)).not_to be expect(Vote.count).to eq(0) end @@ -205,7 +205,7 @@ describe Signature do it "does not call assign_vote_to_user" do signature = create(:signature, document_number: "123A") - expect(signature).to_not receive(:assign_vote_to_user) + expect(signature).not_to receive(:assign_vote_to_user) signature.verify end @@ -213,7 +213,7 @@ describe Signature do signature = create(:signature, document_number: "123A") signature.verify - expect(signature).to_not be_verified + expect(signature).not_to be_verified end end diff --git a/spec/models/topic_spec.rb b/spec/models/topic_spec.rb index 8e2291e5a..2add13bc5 100644 --- a/spec/models/topic_spec.rb +++ b/spec/models/topic_spec.rb @@ -13,17 +13,17 @@ describe Topic do it "is not valid without an author" do topic.author = nil - expect(topic).to_not be_valid + expect(topic).not_to be_valid end it "is not valid without a title" do topic.title = nil - expect(topic).to_not be_valid + expect(topic).not_to be_valid end it "is not valid without a description" do topic.description = nil - expect(topic).to_not be_valid + expect(topic).not_to be_valid end context "order" do diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index fcae4742a..25084e4d1 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -41,7 +41,7 @@ describe User do flagged = user.comment_flags([comment1, comment2, comment3]) expect(flagged[comment1.id]).to be - expect(flagged[comment2.id]).to_not be + expect(flagged[comment2.id]).not_to be expect(flagged[comment3.id]).to be end end @@ -55,7 +55,7 @@ describe User do describe "#terms" do it "is not valid without accepting the terms of service" do subject.terms_of_service = nil - expect(subject).to_not be_valid + expect(subject).not_to be_valid end end @@ -190,14 +190,14 @@ describe User do describe "verified_organization?" do it "is falsy when the user is not an organization" do - expect(subject).to_not be_verified_organization + expect(subject).not_to be_verified_organization end describe 'when it is an organization' do before { create(:organization, user: subject) } it "is false when the user is not a verified organization" do - expect(subject).to_not be_verified_organization + expect(subject).not_to be_verified_organization end it "is true when the user is a verified organization" do @@ -221,7 +221,7 @@ describe User do expect(subject).to be_valid subject.organization.name = nil - expect(subject).to_not be_valid + expect(subject).not_to be_valid end end @@ -355,7 +355,7 @@ describe User do expect(described_class.active).to include(user1) expect(described_class.active).to include(user2) - expect(described_class.active).to_not include(user3) + expect(described_class.active).not_to include(user3) end it "returns users that have not been blocked" do @@ -366,7 +366,7 @@ describe User do expect(described_class.active).to include(user1) expect(described_class.active).to include(user2) - expect(described_class.active).to_not include(user3) + expect(described_class.active).not_to include(user3) end end @@ -380,7 +380,7 @@ describe User do expect(described_class.erased).to include(user1) expect(described_class.erased).to include(user2) - expect(described_class.erased).to_not include(user3) + expect(described_class.erased).not_to include(user3) end end @@ -497,7 +497,7 @@ describe User do user.erase('an identity test') - expect(Identity.exists?(identity.id)).to_not be + expect(Identity.exists?(identity.id)).not_to be end end diff --git a/spec/models/verification/letter_spec.rb b/spec/models/verification/letter_spec.rb index d4fe25035..2e4121ad2 100644 --- a/spec/models/verification/letter_spec.rb +++ b/spec/models/verification/letter_spec.rb @@ -14,7 +14,7 @@ describe Verification::Letter do it "is not valid without a user" do letter.user = nil - expect(letter).to_not be_valid + expect(letter).not_to be_valid end end diff --git a/spec/models/verification/management/email_spec.rb b/spec/models/verification/management/email_spec.rb index 57019c1e8..f5077b900 100644 --- a/spec/models/verification/management/email_spec.rb +++ b/spec/models/verification/management/email_spec.rb @@ -7,23 +7,23 @@ describe Verification::Management::Email do it "returns nil/false when the user does not exist" do expect(subject.user).to be_nil - expect(subject.user?).to_not be + expect(subject.user?).not_to be end end describe "validations" do it "is not valid if the user does not exist" do - expect(described_class.new(document_type: "1", document_number: "1234", email: "inexisting@gmail.com")).to_not be_valid + expect(described_class.new(document_type: "1", document_number: "1234", email: "inexisting@gmail.com")).not_to be_valid end it "is not valid if the user is already level 3" do user = create(:user, :level_three) - expect(described_class.new(document_type: "1", document_number: "1234", email: user.email)).to_not be_valid + expect(described_class.new(document_type: "1", document_number: "1234", email: user.email)).not_to be_valid end it "is not valid if the user already has a different document number" do user = create(:user, document_number: "1234", document_type: "1") - expect(described_class.new(document_type: "1", document_number: "5678", email: user.email)).to_not be_valid + expect(described_class.new(document_type: "1", document_number: "5678", email: user.email)).not_to be_valid end end diff --git a/spec/models/verification/residence_spec.rb b/spec/models/verification/residence_spec.rb index 72714ad07..cb7075dfe 100644 --- a/spec/models/verification/residence_spec.rb +++ b/spec/models/verification/residence_spec.rb @@ -19,7 +19,7 @@ describe Verification::Residence do it "is not valid without a date of birth" do residence = described_class.new("date_of_birth(3i)" => "", "date_of_birth(2i)" => "", "date_of_birth(1i)" => "") - expect(residence).to_not be_valid + expect(residence).not_to be_valid expect(residence.errors[:date_of_birth]).to include("can't be blank") end end @@ -28,7 +28,7 @@ describe Verification::Residence do residence = described_class.new("date_of_birth(3i)" => "1", "date_of_birth(2i)" => "1", "date_of_birth(1i)" => 5.years.ago.year.to_s) - expect(residence).to_not be_valid + expect(residence).not_to be_valid expect(residence.errors[:date_of_birth]).to include("You don't have the required age to participate") end @@ -45,7 +45,7 @@ describe Verification::Residence do it "validates census terms" do residence.terms_of_service = nil - expect(residence).to_not be_valid + expect(residence).not_to be_valid end end diff --git a/spec/models/verification/sms_spec.rb b/spec/models/verification/sms_spec.rb index 9c851a2e8..e2fa0ebe1 100644 --- a/spec/models/verification/sms_spec.rb +++ b/spec/models/verification/sms_spec.rb @@ -9,14 +9,14 @@ describe Verification::Sms do it "validates uniqness of phone" do create(:user, confirmed_phone: "699999999") sms = described_class.new(phone: "699999999") - expect(sms).to_not be_valid + expect(sms).not_to be_valid end it "only allows spaces, numbers and the + sign" do expect(build(:verification_sms, phone: "0034 666666666")).to be_valid expect(build(:verification_sms, phone: "+34 666666666")).to be_valid - expect(build(:verification_sms, phone: "hello there")).to_not be_valid - expect(build(:verification_sms, phone: "555; DROP TABLE USERS")).to_not be_valid + expect(build(:verification_sms, phone: "hello there")).not_to be_valid + expect(build(:verification_sms, phone: "555; DROP TABLE USERS")).not_to be_valid end end \ No newline at end of file diff --git a/spec/models/vote_spec.rb b/spec/models/vote_spec.rb index e9d949ec8..06ae2269b 100644 --- a/spec/models/vote_spec.rb +++ b/spec/models/vote_spec.rb @@ -89,7 +89,7 @@ describe Vote do comment_on_hidden_proposal = create(:comment, commentable: hidden_proposal) vote = create(:vote, votable: comment_on_hidden_proposal) - expect(described_class.public_for_api).to_not include(vote) + expect(described_class.public_for_api).not_to include(vote) end it 'blocks votes on comments on hidden debates' do @@ -97,7 +97,7 @@ describe Vote do comment_on_hidden_debate = create(:comment, commentable: hidden_debate) vote = create(:vote, votable: comment_on_hidden_debate) - expect(described_class.public_for_api).to_not include(vote) + expect(described_class.public_for_api).not_to include(vote) end it 'blocks any other kind of votes' do diff --git a/spec/shared/features/mappable.rb b/spec/shared/features/mappable.rb index 6e1cca64b..4f01ac5bb 100644 --- a/spec/shared/features/mappable.rb +++ b/spec/shared/features/mappable.rb @@ -90,7 +90,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, check "#{mappable_factory_name}_skip_map" send("submit_#{mappable_factory_name}_form") - expect(page).to_not have_content "Map location can't be blank" + expect(page).not_to have_content "Map location can't be blank" end scenario 'Toggle map', :js do @@ -99,8 +99,8 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, check "#{mappable_factory_name}_skip_map" - expect(page).to_not have_css(".map") - expect(page).to_not have_content("Remove map marker") + expect(page).not_to have_css(".map") + expect(page).not_to have_content("Remove map marker") uncheck "#{mappable_factory_name}_skip_map" @@ -179,7 +179,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, click_link "Remove map marker" click_on "Save changes" - expect(page).to_not have_content "Map location can't be blank" + expect(page).not_to have_content "Map location can't be blank" end scenario 'No need to skip map on update' do @@ -189,7 +189,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, click_link "Remove map marker" click_on "Save changes" - expect(page).to_not have_content "Map location can't be blank" + expect(page).not_to have_content "Map location can't be blank" end end diff --git a/spec/shared/features/relationable.rb b/spec/shared/features/relationable.rb index 8c0048672..e0aa4f0b1 100644 --- a/spec/shared/features/relationable.rb +++ b/spec/shared/features/relationable.rb @@ -21,7 +21,7 @@ shared_examples "relationable" do |relationable_model_name| scenario 'related contents list is not rendered if there are no relations' do visit send("#{relationable.class.name.downcase}_path", relationable) - expect(page).to_not have_css("#related-content-list") + expect(page).not_to have_css("#related-content-list") end scenario 'related contents can be added' do @@ -80,7 +80,7 @@ shared_examples "relationable" do |relationable_model_name| within("#related-content-list") do find("#related-content-#{related_content.opposite_related_content.id}").hover find("#score-positive-related-#{related_content.opposite_related_content.id}").click - expect(page).to_not have_css("#score-positive-related-#{related_content.opposite_related_content.id}") + expect(page).not_to have_css("#score-positive-related-#{related_content.opposite_related_content.id}") end expect(related_content.related_content_scores.find_by(user_id: user.id, related_content_id: related_content.id).value).to eq(1) @@ -97,7 +97,7 @@ shared_examples "relationable" do |relationable_model_name| within("#related-content-list") do find("#related-content-#{related_content.opposite_related_content.id}").hover find("#score-negative-related-#{related_content.opposite_related_content.id}").click - expect(page).to_not have_css("#score-negative-related-#{related_content.opposite_related_content.id}") + expect(page).not_to have_css("#score-negative-related-#{related_content.opposite_related_content.id}") end expect(related_content.related_content_scores.find_by(user_id: user.id, related_content_id: related_content.id).value).to eq(-1) @@ -119,6 +119,6 @@ shared_examples "relationable" do |relationable_model_name| visit send("#{relationable.class.name.downcase}_path", relationable) - expect(page).to_not have_css("#related-content-list") + expect(page).not_to have_css("#related-content-list") end end diff --git a/spec/shared/models/acts_as_imageable.rb b/spec/shared/models/acts_as_imageable.rb index 710ea5b4a..d174ee749 100644 --- a/spec/shared/models/acts_as_imageable.rb +++ b/spec/shared/models/acts_as_imageable.rb @@ -12,14 +12,14 @@ shared_examples "acts as imageable" do |imageable_factory| it "is not valid with '.png' extension" do image.attachment = File.new("spec/fixtures/files/clippy.png") - expect(image).to_not be_valid + expect(image).not_to be_valid expect(image.errors[:attachment].size).to eq(1) end it "is not valid with '.gif' extension" do image.attachment = File.new("spec/fixtures/files/clippy.gif") - expect(image).to_not be_valid + expect(image).not_to be_valid expect(image.errors[:attachment].size).to eq(1) end @@ -49,19 +49,19 @@ shared_examples "acts as imageable" do |imageable_factory| it "is not valid when correct image attached but no image title provided" do image.title = '' - expect(image).to_not be_valid + expect(image).not_to be_valid end it "is not valid when image title is too short" do image.title = 'a' * 3 - expect(image).to_not be_valid + expect(image).not_to be_valid end it "is not valid when image title is too long" do image.title = 'a' * 81 - expect(image).to_not be_valid + expect(image).not_to be_valid end end diff --git a/spec/shared/models/document_validations.rb b/spec/shared/models/document_validations.rb index 43b65f97a..154c2f238 100644 --- a/spec/shared/models/document_validations.rb +++ b/spec/shared/models/document_validations.rb @@ -14,13 +14,13 @@ shared_examples "document validations" do |documentable_factory| it "is not valid without a title" do document.title = nil - expect(document).to_not be_valid + expect(document).not_to be_valid end it "is not valid without an attachment" do document.attachment = nil - expect(document).to_not be_valid + expect(document).not_to be_valid end it "is valid for all accepted content types" do @@ -35,28 +35,28 @@ shared_examples "document validations" do |documentable_factory| it "is not valid for attachments larger than documentable max_file_size definition" do document.stub(:attachment_file_size).and_return(maxfilesize.megabytes + 1.byte) - expect(document).to_not be_valid + expect(document).not_to be_valid expect(document.errors[:attachment]).to include "must be in between 0 Bytes and #{maxfilesize} MB" end it "is not valid without a user_id" do document.user_id = nil - expect(document).to_not be_valid + expect(document).not_to be_valid end it "is not valid without a documentable_id" do document.save document.documentable_id = nil - expect(document).to_not be_valid + expect(document).not_to be_valid end it "is not valid without a documentable_type" do document.save document.documentable_type = nil - expect(document).to_not be_valid + expect(document).not_to be_valid end end \ No newline at end of file diff --git a/spec/shared/models/image_validations.rb b/spec/shared/models/image_validations.rb index 0d974d45f..691d73bae 100644 --- a/spec/shared/models/image_validations.rb +++ b/spec/shared/models/image_validations.rb @@ -13,13 +13,13 @@ shared_examples "image validations" do |imageable_factory| it "is not valid without a title" do image.title = nil - expect(image).to_not be_valid + expect(image).not_to be_valid end it "is not valid without an attachment" do image.attachment = nil - expect(image).to_not be_valid + expect(image).not_to be_valid end it "is valid for all accepted content types" do @@ -43,28 +43,28 @@ shared_examples "image validations" do |imageable_factory| it "is not valid for attachments larger than imageable max_file_size definition" do allow(image).to receive(:attachment_file_size).and_return(Image::MAX_IMAGE_SIZE + 1.byte) - expect(image).to_not be_valid + expect(image).not_to be_valid expect(image.errors[:attachment]).to include "must be in between 0 Bytes and 1 MB" end it "is not valid without a user_id" do image.user_id = nil - expect(image).to_not be_valid + expect(image).not_to be_valid end it "is not valid without a imageable_id" do image.save image.imageable_id = nil - expect(image).to_not be_valid + expect(image).not_to be_valid end it "is not valid without a imageable_type" do image.save image.imageable_type = nil - expect(image).to_not be_valid + expect(image).not_to be_valid end end \ No newline at end of file diff --git a/spec/shared/models/map_validations.rb b/spec/shared/models/map_validations.rb index 4035f06a9..8ec63af51 100644 --- a/spec/shared/models/map_validations.rb +++ b/spec/shared/models/map_validations.rb @@ -39,13 +39,13 @@ shared_examples "map validations" do mappable.map_location = nil mappable.skip_map = nil - expect(mappable).to_not be_valid + expect(mappable).not_to be_valid end it "is not valid without accepting that the mappable has no map" do mappable.skip_map = nil - expect(mappable).to_not be_valid + expect(mappable).not_to be_valid end end diff --git a/spec/shared/models/notifiable.rb b/spec/shared/models/notifiable.rb index 0733443f0..8d69e1c00 100644 --- a/spec/shared/models/notifiable.rb +++ b/spec/shared/models/notifiable.rb @@ -40,7 +40,7 @@ shared_examples "notifiable" do notifiable.hide notification.reload - expect(notification.notifiable_available?).to_not be(true) + expect(notification.notifiable_available?).not_to be(true) end it "returns false when it's a reply to comment and the commentable has been hidden" do diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index 4080afb8d..c199b0124 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -141,7 +141,7 @@ module CommonActions end def expect_to_not_be_signed_in - expect(find('.top-bar')).to_not have_content 'My account' + expect(find('.top-bar')).not_to have_content 'My account' end def select_date(values, selector) @@ -210,12 +210,12 @@ module CommonActions def expect_message_voting_not_allowed expect(page).to have_content 'Voting phase is closed' - expect(page).to_not have_selector('.in-favor a') + expect(page).not_to have_selector('.in-favor a') end def expect_message_selecting_not_allowed expect(page).to have_content 'No Selecting Allowed' - expect(page).to_not have_selector('.in-favor a') + expect(page).not_to have_selector('.in-favor a') end def expect_message_organizations_cannot_vote @@ -297,8 +297,8 @@ module CommonActions def expect_no_badge_for(resource_name, resource) within("##{resource_name}_#{resource.id}") do - expect(page).to_not have_css ".label.round" - expect(page).to_not have_content "Employee" + expect(page).not_to have_css ".label.round" + expect(page).not_to have_content "Employee" end end @@ -314,7 +314,7 @@ module CommonActions within("#poll_question_#{question.id}_answers") do click_link answer.to_s - expect(page).to_not have_link(answer.to_s) + expect(page).not_to have_link(answer.to_s) end end diff --git a/spec/support/verifiable.rb b/spec/support/verifiable.rb index 9f6be1355..c8d2e5701 100644 --- a/spec/support/verifiable.rb +++ b/spec/support/verifiable.rb @@ -8,7 +8,7 @@ shared_examples_for "verifiable" do user2 = create(:user, verified_at: nil) expect(model.level_three_verified).to include(user1) - expect(model.level_three_verified).to_not include(user2) + expect(model.level_three_verified).not_to include(user2) end end @@ -20,8 +20,8 @@ shared_examples_for "verifiable" do user4 = create(:user, level_two_verified_at: Time.current) expect(model.level_two_verified).to include(user1) - expect(model.level_two_verified).to_not include(user2) - expect(model.level_two_verified).to_not include(user3) + expect(model.level_two_verified).not_to include(user2) + expect(model.level_two_verified).not_to include(user3) expect(model.level_two_verified).to include(user4) end end @@ -36,8 +36,8 @@ shared_examples_for "verifiable" do expect(model.level_two_or_three_verified).to include(user1) expect(model.level_two_or_three_verified).to include(user2) - expect(model.level_two_or_three_verified).to_not include(user3) - expect(model.level_two_or_three_verified).to_not include(user4) + expect(model.level_two_or_three_verified).not_to include(user3) + expect(model.level_two_or_three_verified).not_to include(user4) expect(model.level_two_or_three_verified).to include(user5) end end @@ -53,8 +53,8 @@ shared_examples_for "verifiable" do expect(model.unverified).to include(user1) expect(model.unverified).to include(user2) expect(model.unverified).to include(user3) - expect(model.unverified).to_not include(user4) - expect(model.unverified).to_not include(user5) + expect(model.unverified).not_to include(user4) + expect(model.unverified).not_to include(user5) end end @@ -70,8 +70,8 @@ shared_examples_for "verifiable" do expect(model.incomplete_verification).to include(user1) expect(model.incomplete_verification).to include(user2) - expect(model.incomplete_verification).to_not include(user3) - expect(model.incomplete_verification).to_not include(user4) + expect(model.incomplete_verification).not_to include(user3) + expect(model.incomplete_verification).not_to include(user4) end end end