From 9d7fa9d0f88337f88e9141f9159fd9a856d5465c Mon Sep 17 00:00:00 2001 From: taitus Date: Wed, 20 Nov 2024 11:06:28 +0100 Subject: [PATCH] Unify notice responders for budget investments create action --- .../management/budgets/investments_controller.rb | 4 ++-- spec/system/budgets/investments_spec.rb | 4 ++-- spec/system/emails_spec.rb | 2 +- spec/system/management/budget_investments_spec.rb | 6 +++--- spec/system/tags/budget_investments_spec.rb | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/controllers/management/budgets/investments_controller.rb b/app/controllers/management/budgets/investments_controller.rb index c03ced8bb..5d1b32577 100644 --- a/app/controllers/management/budgets/investments_controller.rb +++ b/app/controllers/management/budgets/investments_controller.rb @@ -26,8 +26,8 @@ class Management::Budgets::InvestmentsController < Management::BaseController @investment.heading = @budget.headings.first if @budget.single_heading? if @investment.save - notice = t("flash.actions.create.notice", resource_name: Budget::Investment.model_name.human, count: 1) - redirect_to management_budget_investment_path(@budget, @investment), notice: notice + redirect_to management_budget_investment_path(@budget, @investment), + notice: t("flash.actions.create.budget_investment") else render :new end diff --git a/spec/system/budgets/investments_spec.rb b/spec/system/budgets/investments_spec.rb index 87eb79e50..b18ff6e81 100644 --- a/spec/system/budgets/investments_spec.rb +++ b/spec/system/budgets/investments_spec.rb @@ -610,7 +610,7 @@ describe "Budget Investments" do click_button "Create Investment" - expect(page).to have_content "Investment created successfully" + expect(page).to have_content "Budget Investment created successfully" expect(page).to have_content "Build a skyscraper" expect(page).to have_content "I want to live in a high tower over the clouds" expect(page).to have_content "City center" @@ -678,7 +678,7 @@ describe "Budget Investments" do click_button "Create Investment" - expect(page).to have_content "Investment created successfully" + expect(page).to have_content "Budget Investment created successfully" expect(page).to have_content "Build a skyscraper" expect(page).to have_content "I want to live in a high tower over the clouds" expect(page).to have_content "City center" diff --git a/spec/system/emails_spec.rb b/spec/system/emails_spec.rb index 0612d6087..f97b521b9 100644 --- a/spec/system/emails_spec.rb +++ b/spec/system/emails_spec.rb @@ -358,7 +358,7 @@ describe "Emails" do check "budget_investment_terms_of_service" click_button "Create Investment" - expect(page).to have_content "Investment created successfully" + expect(page).to have_content "Budget Investment created successfully" email = open_last_email diff --git a/spec/system/management/budget_investments_spec.rb b/spec/system/management/budget_investments_spec.rb index 7fcbe2763..cba7b53f5 100644 --- a/spec/system/management/budget_investments_spec.rb +++ b/spec/system/management/budget_investments_spec.rb @@ -14,7 +14,7 @@ describe "Budget Investments" do { budget_id: "budget_id" }, "documentable_fill_new_valid_budget_investment", "Create Investment", - "Investment created successfully.", + "Budget Investment created successfully.", management: true it_behaves_like "nested imageable", @@ -23,7 +23,7 @@ describe "Budget Investments" do { budget_id: "budget_id" }, "imageable_fill_new_valid_budget_investment", "Create Investment", - "Investment created successfully.", + "Budget Investment created successfully.", management: true it_behaves_like "mappable", @@ -73,7 +73,7 @@ describe "Budget Investments" do click_button "Create Investment" - expect(page).to have_content "Investment created successfully." + expect(page).to have_content "Budget Investment created successfully." expect(page).to have_content "Health" expect(page).to have_content "Build a park in my neighborhood" diff --git a/spec/system/tags/budget_investments_spec.rb b/spec/system/tags/budget_investments_spec.rb index f032c6041..8f49284dd 100644 --- a/spec/system/tags/budget_investments_spec.rb +++ b/spec/system/tags/budget_investments_spec.rb @@ -76,7 +76,7 @@ describe "Tags" do click_button "Create Investment" - expect(page).to have_content "Investment created successfully." + expect(page).to have_content "Budget Investment created successfully." expect(page).to have_content tag_economia.name expect(page).to have_content tag_medio_ambiente.name end @@ -93,7 +93,7 @@ describe "Tags" do find(".js-add-tag-link", text: tag_economia.name).click click_button "Create Investment" - expect(page).to have_content "Investment created successfully." + expect(page).to have_content "Budget Investment created successfully." expect(page).to have_content "Build a skyscraper" within ".tags" do @@ -117,7 +117,7 @@ describe "Tags" do find(".js-add-tag-link", text: "Education").click click_button "Create Investment" - expect(page).to have_content "Investment created successfully." + expect(page).to have_content "Budget Investment created successfully." expect(page).to have_content "Build a skyscraper" within ".tags" do @@ -141,7 +141,7 @@ describe "Tags" do find(".js-add-tag-link", text: "Education").click click_button "Create Investment" - expect(page).to have_content "Investment created successfully." + expect(page).to have_content "Budget Investment created successfully." expect(page).to have_content "Build a skyscraper" within ".tags" do @@ -181,7 +181,7 @@ describe "Tags" do click_button "Create Investment" - expect(page).to have_content "Investment created successfully." + expect(page).to have_content "Budget Investment created successfully." expect(page).to have_content "user_id1" expect(page).to have_content "a3" expect(page).to have_content "scriptalert('hey');script"