Improve budget phase HTML ID

Some browsers might not recognize an ID as valid when it starts with a
number.
This commit is contained in:
Javi Martín
2021-03-26 04:22:56 +01:00
parent b2bb0c7143
commit cf4e6d2c64
2 changed files with 4 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ class Budgets::PhasesComponent < ApplicationComponent
end
def phase_dom_id(phase)
"#{phases.index(phase) + 1}-#{phase.name.parameterize}"
"phase-#{phases.index(phase) + 1}-#{phase.name.parameterize}"
end
def prev_phase_dom_id(phase)

View File

@@ -217,9 +217,9 @@ describe "Budgets" do
click_link "Custom name for accepting phase"
within("#2-custom-name-for-accepting-phase") do
expect(page).to have_link("Previous phase", href: "#1-custom-name-for-informing-phase")
expect(page).to have_link("Next phase", href: "#3-custom-name-for-selecting-phase")
within("#phase-2-custom-name-for-accepting-phase") do
expect(page).to have_link "Previous phase", href: "#phase-1-custom-name-for-informing-phase"
expect(page).to have_link "Next phase", href: "#phase-3-custom-name-for-selecting-phase"
end
end