Apply Capybara/CurrentPathExpectation rubocop rule

This commit is contained in:
Javi Martín
2019-06-23 02:13:38 +02:00
parent 969a4e21c9
commit c05b9c2aac
6 changed files with 9 additions and 8 deletions

View File

@@ -183,9 +183,6 @@ RSpec/BeEql:
RSpec/BeforeAfterAll:
Enabled: true
Capybara/CurrentPathExpectation:
Enabled: true
Capybara/FeatureMethods:
Enabled: false

View File

@@ -11,6 +11,9 @@ AllCops:
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
Capybara/CurrentPathExpectation:
Enabled: true
Capybara/FeatureMethods:
Enabled: true
EnabledMethods:

View File

@@ -205,7 +205,8 @@ describe "Admin activity" do
within("#proposal_#{proposal.id}") do
click_link "Hide author"
expect(current_path).to eq(debates_path)
expect(page).to have_current_path(debates_path)
end
visit admin_activity_path

View File

@@ -18,7 +18,7 @@ describe "Admin users" do
scenario "The username links to their public profile" do
click_link @user.name
expect(current_path).to eq(user_path(@user))
expect(page).to have_current_path(user_path(@user))
end
scenario "Search" do

View File

@@ -18,7 +18,7 @@ describe "Admin Budgets" do
balloting_phase = budget.phases.where(kind: "balloting").first
expect(current_path).to match(/admin\/polls\/\d+/)
expect(page).to have_current_path(/admin\/polls\/\d+/)
expect(page).to have_content(budget.name)
expect(page).to have_content(balloting_phase.starts_at.to_date)
expect(page).to have_content(balloting_phase.ends_at.to_date)
@@ -37,7 +37,7 @@ describe "Admin Budgets" do
click_link "Bulletins de ladmin"
expect(current_path).to match(/admin\/polls\/\d+/)
expect(page).to have_current_path(/admin\/polls\/\d+/)
expect(page).to have_content("Budget pour le changement climatique")
expect(Poll.count).to eq(1)

View File

@@ -1948,7 +1948,7 @@ describe "Successful proposals" do
click_link "Create a proposal"
end
expect(current_path).to eq(new_proposal_path)
expect(page).to have_current_path(new_proposal_path)
fill_in "Proposal title", with: "Help refugees"
fill_in "Proposal summary", with: "In summary what we want is..."