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

@@ -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'