Merge pull request #2293 from wairbut-m2c/aperez-fix-deprecation-warnings
Fix for test suite deprecations warnings
This commit is contained in:
@@ -12,7 +12,7 @@ feature 'Account' do
|
||||
|
||||
click_link "My account"
|
||||
|
||||
expect(page).to have_current_path(account_path, only_path: true)
|
||||
expect(page).to have_current_path(account_path, ignore_query: true)
|
||||
|
||||
expect(page).to have_selector("input[value='Manuela Colau']")
|
||||
expect(page).to have_selector(avatar('Manuela Colau'), count: 1)
|
||||
@@ -116,7 +116,7 @@ feature 'Account' do
|
||||
|
||||
click_link 'My account'
|
||||
|
||||
expect(page).to have_current_path(account_path, only_path: true)
|
||||
expect(page).to have_current_path(account_path, ignore_query: true)
|
||||
|
||||
expect(page).to have_link('Change my credentials')
|
||||
click_link 'Change my credentials'
|
||||
|
||||
@@ -676,8 +676,8 @@ feature 'Admin budget investments' do
|
||||
click_link "Download current selection"
|
||||
|
||||
header = page.response_headers['Content-Disposition']
|
||||
header.should match(/^attachment/)
|
||||
header.should match(/filename="budget_investments.csv"$/)
|
||||
expect(header).to match(/^attachment/)
|
||||
expect(header).to match(/filename="budget_investments.csv"$/)
|
||||
|
||||
expect(page).to have_content investment2.title
|
||||
expect(page).not_to have_content investment1.title
|
||||
|
||||
@@ -46,7 +46,7 @@ feature 'Admin officials' do
|
||||
fill_in 'name_or_email', with: @citizen.email
|
||||
click_button 'Search'
|
||||
|
||||
expect(page).to have_current_path(search_admin_officials_path, only_path: true)
|
||||
expect(page).to have_current_path(search_admin_officials_path, ignore_query: true)
|
||||
expect(page).not_to have_content @official.name
|
||||
|
||||
click_link @citizen.name
|
||||
@@ -71,7 +71,7 @@ feature 'Admin officials' do
|
||||
click_link "Remove 'Official' status"
|
||||
|
||||
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 have_current_path(admin_officials_path, ignore_query: true)
|
||||
expect(page).not_to have_content @citizen.name
|
||||
expect(page).not_to have_content @official.name
|
||||
end
|
||||
|
||||
@@ -40,7 +40,7 @@ feature 'Admin::Organizations' do
|
||||
fill_in "term", with: " "
|
||||
click_button "Search"
|
||||
|
||||
expect(page).to have_current_path(search_admin_organizations_path, only_path: true)
|
||||
expect(page).to have_current_path(search_admin_organizations_path, ignore_query: true)
|
||||
within("#search-results") do
|
||||
expect(page).not_to have_content("Get up, Stand up")
|
||||
end
|
||||
@@ -88,13 +88,13 @@ feature 'Admin::Organizations' do
|
||||
|
||||
visit admin_organizations_path
|
||||
within("#organization_#{organization.id}") do
|
||||
expect(page).to have_current_path(admin_organizations_path, only_path: true)
|
||||
expect(page).to have_current_path(admin_organizations_path, ignore_query: true)
|
||||
expect(page).to have_link('Verify')
|
||||
expect(page).to have_link('Reject')
|
||||
|
||||
click_on 'Verify'
|
||||
end
|
||||
expect(page).to have_current_path(admin_organizations_path, only_path: true)
|
||||
expect(page).to have_current_path(admin_organizations_path, ignore_query: true)
|
||||
expect(page).to have_content 'Verified'
|
||||
|
||||
expect(organization.reload.verified?).to eq(true)
|
||||
@@ -114,7 +114,7 @@ feature 'Admin::Organizations' do
|
||||
|
||||
click_on 'Reject'
|
||||
end
|
||||
expect(page).to have_current_path(admin_organizations_path, only_path: true)
|
||||
expect(page).to have_current_path(admin_organizations_path, ignore_query: true)
|
||||
expect(page).not_to have_content organization.name
|
||||
|
||||
click_on 'Rejected'
|
||||
@@ -136,7 +136,7 @@ feature 'Admin::Organizations' do
|
||||
|
||||
click_on 'Verify'
|
||||
end
|
||||
expect(page).to have_current_path(admin_organizations_path, only_path: true)
|
||||
expect(page).to have_current_path(admin_organizations_path, ignore_query: true)
|
||||
expect(page).not_to have_content organization.name
|
||||
click_on('Verified')
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ feature 'Admin poll questions' do
|
||||
visit proposals_path
|
||||
click_link "Create question"
|
||||
|
||||
expect(page).to have_current_path(new_admin_question_path, only_path: true)
|
||||
expect(page).to have_current_path(new_admin_question_path, ignore_query: true)
|
||||
expect(page).to have_field('poll_question_title', with: proposal.title)
|
||||
|
||||
select 'Proposals', from: 'poll_question_poll_id'
|
||||
|
||||
@@ -310,7 +310,7 @@ feature 'Ballots' do
|
||||
click_link group.name
|
||||
# No need to click on the heading name
|
||||
expect(page).to have_content("Investment projects with scope: #{heading.name}")
|
||||
expect(page).to have_current_path(budget_investments_path(budget), only_path: true)
|
||||
expect(page).to have_current_path(budget_investments_path(budget), ignore_query: true)
|
||||
end
|
||||
|
||||
scenario 'Displaying the correct group, heading, count & amount' do
|
||||
|
||||
@@ -95,7 +95,7 @@ feature 'Proposals' do
|
||||
fill_in "search", with: "what you got"
|
||||
click_button "Search"
|
||||
|
||||
expect(page).to have_current_path(management_proposals_path, only_path: true)
|
||||
expect(page).to have_current_path(management_proposals_path, ignore_query: true)
|
||||
|
||||
within(".proposals-list") do
|
||||
expect(page).to have_css('.proposal', count: 1)
|
||||
|
||||
@@ -149,7 +149,7 @@ feature 'Poll Officing' do
|
||||
end
|
||||
|
||||
in_browser(:one) do
|
||||
page.should have_content("Here you can validate user documents and store voting results")
|
||||
expect(page).to have_content("Here you can validate user documents and store voting results")
|
||||
|
||||
visit new_officing_residence_path
|
||||
select 'DNI', from: 'residence_document_type'
|
||||
@@ -162,11 +162,11 @@ feature 'Poll Officing' do
|
||||
expect(Poll::Voter.where(document_number: '12345678Z', poll_id: poll, origin: 'booth', officer_id: officer1).count).to be(1)
|
||||
|
||||
visit final_officing_polls_path
|
||||
page.should have_content("Polls ready for final recounting")
|
||||
expect(page).to have_content("Polls ready for final recounting")
|
||||
end
|
||||
|
||||
in_browser(:two) do
|
||||
page.should have_content("Here you can validate user documents and store voting results")
|
||||
expect(page).to have_content("Here you can validate user documents and store voting results")
|
||||
|
||||
visit new_officing_residence_path
|
||||
select 'DNI', from: 'residence_document_type'
|
||||
@@ -179,7 +179,7 @@ feature 'Poll Officing' do
|
||||
expect(Poll::Voter.where(document_number: '12345678Y', poll_id: poll, origin: 'booth', officer_id: officer2).count).to be(1)
|
||||
|
||||
visit final_officing_polls_path
|
||||
page.should have_content("Polls ready for final recounting")
|
||||
expect(page).to have_content("Polls ready for final recounting")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,7 +29,7 @@ feature "Voter" do
|
||||
expect(page).not_to have_link(answer_yes.title)
|
||||
end
|
||||
|
||||
find(:css, ".js-token-message").should be_visible
|
||||
expect(find(:css, ".js-token-message")).to be_visible
|
||||
token = find(:css, ".js-question-answer")[:href].gsub(/.+?(?=token)/, '').gsub('token=', '')
|
||||
|
||||
expect(page).to have_content "You can write down this vote identifier, to check your vote on the final results: #{token}"
|
||||
|
||||
@@ -105,6 +105,8 @@ RSpec.configure do |config|
|
||||
# test failures related to randomization by passing the same `--seed` value
|
||||
# as the one that triggered the failure.
|
||||
Kernel.srand config.seed
|
||||
|
||||
config.expect_with(:rspec) { |c| c.syntax = :expect }
|
||||
end
|
||||
|
||||
# Parallel build helper configuration for travis
|
||||
|
||||
Reference in New Issue
Block a user