diff --git a/app/views/budgets/index.html.erb b/app/views/budgets/index.html.erb index 729975469..4f9184477 100644 --- a/app/views/budgets/index.html.erb +++ b/app/views/budgets/index.html.erb @@ -33,7 +33,7 @@ <% if current_user %> <% if current_user.level_two_or_three_verified? %> <%= link_to t("budgets.investments.index.sidebar.create"), - new_budget_investment_path(@budget), + new_budget_investment_path(current_budget), class: "button margin-top expanded" %> <% else %>
diff --git a/spec/features/budgets/budgets_spec.rb b/spec/features/budgets/budgets_spec.rb index db0e6b806..a85df36cb 100644 --- a/spec/features/budgets/budgets_spec.rb +++ b/spec/features/budgets/budgets_spec.rb @@ -124,6 +124,15 @@ feature 'Budgets' do expect(page).to have_content "There are no budgets" end + + scenario "Accepting" do + budget.update(phase: "accepting") + login_as(create(:user, :level_two)) + + visit budgets_path + + expect(page).to have_link "Create a budget investment" + end end scenario 'Index shows only published phases' do