From 235e39672eaf121b514105794b71e0d8d4a5cd45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 9 Apr 2021 18:19:51 +0200 Subject: [PATCH] Create admin user before starting a browser Even after the previous changes, this test is still failing sometimes (although now it fails for a different reason). We're doing this change in order to discard it as the reason why the test is failing. --- spec/system/budgets/ballots_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/system/budgets/ballots_spec.rb b/spec/system/budgets/ballots_spec.rb index 6876b4a79..6d5f65014 100644 --- a/spec/system/budgets/ballots_spec.rb +++ b/spec/system/budgets/ballots_spec.rb @@ -630,6 +630,7 @@ describe "Ballots" do scenario "Edge case voting a non-elegible investment" do investment1 = create(:budget_investment, :selected, heading: new_york, price: 10000) + admin_user = create(:administrator).user in_browser(:user) do login_as user @@ -639,7 +640,7 @@ describe "Ballots" do end in_browser(:admin) do - login_as create(:administrator).user + login_as admin_user visit edit_admin_budget_group_heading_path(budget, states, new_york) fill_in "Amount", with: 10 click_button "Save heading"