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:
@@ -54,7 +54,7 @@ feature 'SMS Verification' do
|
||||
visit new_sms_path
|
||||
|
||||
expect(page).to have_content 'You have not yet confirmed your residency'
|
||||
expect(current_path).to eq(new_residence_path)
|
||||
expect(page).to have_current_path(new_residence_path)
|
||||
end
|
||||
|
||||
scenario '5 tries allowed' do
|
||||
@@ -70,11 +70,11 @@ feature 'SMS Verification' do
|
||||
end
|
||||
|
||||
expect(page).to have_content "You have reached the maximum number of attempts. Please try again later."
|
||||
expect(current_path).to eq(account_path)
|
||||
expect(page).to have_current_path(account_path)
|
||||
|
||||
visit new_sms_path
|
||||
expect(page).to have_content "You have reached the maximum number of attempts. Please try again later."
|
||||
expect(current_path).to eq(account_path)
|
||||
expect(page).to have_current_path(account_path)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user