Enable Capybara/CurrentPathExpectation cop & fix issues

Read cop description http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/CurrentPathExpectation to better understand reasons behind enforcing this rule

On some cases the `only_path: true` was needed as argument of `have_current_path` matcher to avoid comparing the url parameters and just checking the path.
This commit is contained in:
Bertocq
2018-01-06 23:12:59 +01:00
parent 48c2df2463
commit 7f14544f71
34 changed files with 158 additions and 155 deletions

View File

@@ -66,7 +66,7 @@ feature 'Verified users' do
login_as(user)
visit verified_user_path
expect(current_path).to eq new_sms_path
expect(page).to have_current_path(new_sms_path)
end
scenario "Select a verified email" do
@@ -86,7 +86,7 @@ feature 'Verified users' do
end
expect(page).to have_content 'We have sent a confirmation email to your account: rock@example.com'
expect(current_path).to eq(account_path)
expect(page).to have_current_path(account_path)
end
scenario "Select a verified phone" do
@@ -122,7 +122,7 @@ feature 'Verified users' do
click_link "Use other phone"
expect(current_path).to eq(new_sms_path)
expect(page).to have_current_path(new_sms_path)
end
scenario "No verified information" do
@@ -131,7 +131,7 @@ feature 'Verified users' do
login_as(user)
visit verified_user_path
expect(current_path).to eq(new_sms_path)
expect(page).to have_current_path(new_sms_path)
end
end