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:
@@ -58,7 +58,7 @@ feature 'Admin poll questions' do
|
||||
visit proposals_path
|
||||
click_link "Create question"
|
||||
|
||||
expect(current_path).to eq(new_admin_question_path)
|
||||
expect(page).to have_current_path(new_admin_question_path, only_path: true)
|
||||
expect(page).to have_field('poll_question_title', with: proposal.title)
|
||||
|
||||
select 'Proposals', from: 'poll_question_poll_id'
|
||||
|
||||
Reference in New Issue
Block a user