diff --git a/app/controllers/admin/budgets_controller.rb b/app/controllers/admin/budgets_controller.rb index 7caf4f35c..f9a529220 100644 --- a/app/controllers/admin/budgets_controller.rb +++ b/app/controllers/admin/budgets_controller.rb @@ -27,7 +27,7 @@ class Admin::BudgetsController < Admin::BaseController def update if @budget.update(budget_params) - redirect_to admin_budget_path(@budget), notice: t('admin.budgets.update.notice') + redirect_to admin_budgets_path, notice: t('admin.budgets.update.notice') else render :edit end diff --git a/spec/features/admin/budgets_spec.rb b/spec/features/admin/budgets_spec.rb index 2585dfe96..04e05bce1 100644 --- a/spec/features/admin/budgets_spec.rb +++ b/spec/features/admin/budgets_spec.rb @@ -109,6 +109,25 @@ feature 'Admin budgets' do end + context 'Update' do + + background do + create(:budget) + end + + scenario 'Update budget' do + visit admin_budgets_path + click_link 'Edit budget' + + fill_in 'budget_name', with: 'More trees on the streets' + click_button 'Update Participatory budget' + + expect(page).to have_content('More trees on the streets') + expect(page).to have_current_path(admin_budgets_path) + end + + end + context "Calculate Budget's Winner Investments" do scenario 'For a Budget in reviewing balloting' do