Fix: Deprecation warnings when running test suite (#2287)

This commit is contained in:
Angel Perez
2018-01-09 16:00:54 -04:00
parent c4e0178947
commit 9a0eca73d7
4 changed files with 9 additions and 7 deletions

View File

@@ -670,8 +670,8 @@ feature 'Admin budget investments' do
filter: :valuation_finished) filter: :valuation_finished)
header = page.response_headers['Content-Disposition'] header = page.response_headers['Content-Disposition']
header.should match(/^attachment/) expect(header).to match(/^attachment/)
header.should match(/filename="budget_investments.csv"$/) expect(header).to match(/filename="budget_investments.csv"$/)
expect(page).to have_content investment2.title expect(page).to have_content investment2.title
expect(page).to_not have_content investment1.title expect(page).to_not have_content investment1.title

View File

@@ -149,7 +149,7 @@ feature 'Poll Officing' do
end end
in_browser(:one) do 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 visit new_officing_residence_path
select 'DNI', from: 'residence_document_type' 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) expect(Poll::Voter.where(document_number: '12345678Z', poll_id: poll, origin: 'booth', officer_id: officer1).count).to be(1)
visit final_officing_polls_path 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
in_browser(:two) do 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 visit new_officing_residence_path
select 'DNI', from: 'residence_document_type' 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) expect(Poll::Voter.where(document_number: '12345678Y', poll_id: poll, origin: 'booth', officer_id: officer2).count).to be(1)
visit final_officing_polls_path 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 end
end end

View File

@@ -29,7 +29,7 @@ feature "Voter" do
expect(page).not_to have_link(answer_yes.title) expect(page).not_to have_link(answer_yes.title)
end 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=', '') 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}" expect(page).to have_content "You can write down this vote identifier, to check your vote on the final results: #{token}"

View File

@@ -105,6 +105,8 @@ RSpec.configure do |config|
# test failures related to randomization by passing the same `--seed` value # test failures related to randomization by passing the same `--seed` value
# as the one that triggered the failure. # as the one that triggered the failure.
Kernel.srand config.seed Kernel.srand config.seed
config.expect_with(:rspec) { |c| c.syntax = :expect }
end end
# Parallel build helper configuration for travis # Parallel build helper configuration for travis