Split budget executions test

This way we avoid consecutive calls to `visit` to the same page.
This commit is contained in:
Javi Martín
2025-03-16 21:00:34 +01:00
parent 7870952dff
commit 04ccbea04e

View File

@@ -10,13 +10,16 @@ describe "Executions" do
let!(:investment4) { create(:budget_investment, :winner, heading: heading) } let!(:investment4) { create(:budget_investment, :winner, heading: heading) }
let!(:investment3) { create(:budget_investment, :incompatible, heading: heading) } let!(:investment3) { create(:budget_investment, :incompatible, heading: heading) }
scenario "finds budget by id or slug" do scenario "finds budget by slug" do
budget.update!(slug: "budget_slug") budget.update!(slug: "budget_slug")
visit budget_executions_path("budget_slug") visit budget_executions_path("budget_slug")
within(".budgets-stats") { expect(page).to have_content budget.name } within(".budgets-stats") { expect(page).to have_content budget.name }
end
scenario "finds budget by id" do
visit budget_executions_path(budget.id)
visit budget_executions_path(budget)
within(".budgets-stats") { expect(page).to have_content budget.name } within(".budgets-stats") { expect(page).to have_content budget.name }
end end