Unify notice responders for budget investments create action
This commit is contained in:
@@ -26,8 +26,8 @@ class Management::Budgets::InvestmentsController < Management::BaseController
|
|||||||
@investment.heading = @budget.headings.first if @budget.single_heading?
|
@investment.heading = @budget.headings.first if @budget.single_heading?
|
||||||
|
|
||||||
if @investment.save
|
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),
|
||||||
redirect_to management_budget_investment_path(@budget, @investment), notice: notice
|
notice: t("flash.actions.create.budget_investment")
|
||||||
else
|
else
|
||||||
render :new
|
render :new
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -610,7 +610,7 @@ describe "Budget Investments" do
|
|||||||
|
|
||||||
click_button "Create Investment"
|
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 "Build a skyscraper"
|
||||||
expect(page).to have_content "I want to live in a high tower over the clouds"
|
expect(page).to have_content "I want to live in a high tower over the clouds"
|
||||||
expect(page).to have_content "City center"
|
expect(page).to have_content "City center"
|
||||||
@@ -678,7 +678,7 @@ describe "Budget Investments" do
|
|||||||
|
|
||||||
click_button "Create Investment"
|
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 "Build a skyscraper"
|
||||||
expect(page).to have_content "I want to live in a high tower over the clouds"
|
expect(page).to have_content "I want to live in a high tower over the clouds"
|
||||||
expect(page).to have_content "City center"
|
expect(page).to have_content "City center"
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ describe "Emails" do
|
|||||||
check "budget_investment_terms_of_service"
|
check "budget_investment_terms_of_service"
|
||||||
|
|
||||||
click_button "Create Investment"
|
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
|
email = open_last_email
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ describe "Budget Investments" do
|
|||||||
{ budget_id: "budget_id" },
|
{ budget_id: "budget_id" },
|
||||||
"documentable_fill_new_valid_budget_investment",
|
"documentable_fill_new_valid_budget_investment",
|
||||||
"Create Investment",
|
"Create Investment",
|
||||||
"Investment created successfully.",
|
"Budget Investment created successfully.",
|
||||||
management: true
|
management: true
|
||||||
|
|
||||||
it_behaves_like "nested imageable",
|
it_behaves_like "nested imageable",
|
||||||
@@ -23,7 +23,7 @@ describe "Budget Investments" do
|
|||||||
{ budget_id: "budget_id" },
|
{ budget_id: "budget_id" },
|
||||||
"imageable_fill_new_valid_budget_investment",
|
"imageable_fill_new_valid_budget_investment",
|
||||||
"Create Investment",
|
"Create Investment",
|
||||||
"Investment created successfully.",
|
"Budget Investment created successfully.",
|
||||||
management: true
|
management: true
|
||||||
|
|
||||||
it_behaves_like "mappable",
|
it_behaves_like "mappable",
|
||||||
@@ -73,7 +73,7 @@ describe "Budget Investments" do
|
|||||||
|
|
||||||
click_button "Create Investment"
|
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 "Health"
|
||||||
expect(page).to have_content "Build a park in my neighborhood"
|
expect(page).to have_content "Build a park in my neighborhood"
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ describe "Tags" do
|
|||||||
|
|
||||||
click_button "Create Investment"
|
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_economia.name
|
||||||
expect(page).to have_content tag_medio_ambiente.name
|
expect(page).to have_content tag_medio_ambiente.name
|
||||||
end
|
end
|
||||||
@@ -93,7 +93,7 @@ describe "Tags" do
|
|||||||
find(".js-add-tag-link", text: tag_economia.name).click
|
find(".js-add-tag-link", text: tag_economia.name).click
|
||||||
click_button "Create Investment"
|
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 "Build a skyscraper"
|
||||||
|
|
||||||
within ".tags" do
|
within ".tags" do
|
||||||
@@ -117,7 +117,7 @@ describe "Tags" do
|
|||||||
find(".js-add-tag-link", text: "Education").click
|
find(".js-add-tag-link", text: "Education").click
|
||||||
click_button "Create Investment"
|
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 "Build a skyscraper"
|
||||||
|
|
||||||
within ".tags" do
|
within ".tags" do
|
||||||
@@ -141,7 +141,7 @@ describe "Tags" do
|
|||||||
find(".js-add-tag-link", text: "Education").click
|
find(".js-add-tag-link", text: "Education").click
|
||||||
click_button "Create Investment"
|
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 "Build a skyscraper"
|
||||||
|
|
||||||
within ".tags" do
|
within ".tags" do
|
||||||
@@ -181,7 +181,7 @@ describe "Tags" do
|
|||||||
|
|
||||||
click_button "Create Investment"
|
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 "user_id1"
|
||||||
expect(page).to have_content "a3"
|
expect(page).to have_content "a3"
|
||||||
expect(page).to have_content "scriptalert('hey');script"
|
expect(page).to have_content "scriptalert('hey');script"
|
||||||
|
|||||||
Reference in New Issue
Block a user