Fix budget investment specs

After adding investment translatable fields to forms, they will be
generated with nested translations names and ids so we can no longer
use standard id locator.

Using input label text to fill in fields works with both types of forms.
This commit is contained in:
Senén Rodero Rodríguez
2019-01-25 11:50:57 +01:00
committed by voodoorai2000
parent 88ce8d7990
commit 5eb5f02cbe
8 changed files with 34 additions and 34 deletions

View File

@@ -1102,8 +1102,8 @@ describe "Admin budget investments" do
visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment)
click_link "Edit"
fill_in "budget_investment_title", with: "Potatoes"
fill_in "budget_investment_description", with: "Carrots"
fill_in "Title", with: "Potatoes"
fill_in "Description", with: "Carrots"
select "#{budget_investment.group.name}: Barbate", from: "budget_investment[heading_id]"
uncheck "budget_investment_incompatible"
check "budget_investment_selected"
@@ -1365,7 +1365,7 @@ describe "Admin budget investments" do
visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment)
click_link "Edit"
fill_in "budget_investment_title", with: ""
fill_in "Title", with: ""
click_button "Update"

View File

@@ -860,9 +860,9 @@ describe "Budget Investments" do
visit new_budget_investment_path(budget)
select heading.name, from: "budget_investment_heading_id"
fill_in "budget_investment_title", with: "I am a bot"
fill_in "Title", with: "I am a bot"
fill_in "budget_investment_subtitle", with: "This is the honeypot"
fill_in "budget_investment_description", with: "This is the description"
fill_in "Description", with: "This is the description"
check "budget_investment_terms_of_service"
click_button "Create Investment"
@@ -879,8 +879,8 @@ describe "Budget Investments" do
visit new_budget_investment_path(budget)
select heading.name, from: "budget_investment_heading_id"
fill_in "budget_investment_title", with: "I am a bot"
fill_in "budget_investment_description", with: "This is the description"
fill_in "Title", with: "I am a bot"
fill_in "Description", with: "This is the description"
check "budget_investment_terms_of_service"
click_button "Create Investment"
@@ -895,8 +895,8 @@ describe "Budget Investments" do
visit new_budget_investment_path(budget)
select heading.name, from: "budget_investment_heading_id"
fill_in "budget_investment_title", with: "Build a skyscraper"
fill_in "budget_investment_description", with: "I want to live in a high tower over the clouds"
fill_in "Title", with: "Build a skyscraper"
fill_in "Description", with: "I want to live in a high tower over the clouds"
fill_in "budget_investment_location", with: "City center"
fill_in "budget_investment_organization_name", with: "T.I.A."
fill_in "budget_investment_tag_list", with: "Towers"
@@ -936,7 +936,7 @@ describe "Budget Investments" do
create(factory, title: "This is the last #{factory}", budget: budget)
visit new_budget_investment_path(budget)
fill_in "budget_investment_title", with: "search"
fill_in "Title", with: "search"
within("div#js-suggest") do
expect(page).to have_content "You are seeing 5 of 6 investments containing the term 'search'"
@@ -951,7 +951,7 @@ describe "Budget Investments" do
end
visit new_budget_investment_path(budget)
fill_in "budget_investment_title", with: "item"
fill_in "Title", with: "item"
within("div#js-suggest") do
expect(page).not_to have_content "You are seeing"
@@ -966,7 +966,7 @@ describe "Budget Investments" do
end
visit new_budget_investment_path(other_budget)
fill_in "budget_investment_title", with: "search"
fill_in "Title", with: "search"
within("div#js-suggest") do
expect(page).not_to have_content "You are seeing"

View File

@@ -365,8 +365,8 @@ describe "Emails" do
visit new_budget_investment_path(budget_id: budget.id)
select heading.name, from: "budget_investment_heading_id"
fill_in "budget_investment_title", with: "Build a hospital"
fill_in "budget_investment_description", with: "We have lots of people that require medical attention"
fill_in "Title", with: "Build a hospital"
fill_in "Description", with: "We have lots of people that require medical attention"
check "budget_investment_terms_of_service"
click_button "Create Investment"

View File

@@ -66,8 +66,8 @@ describe "Budget Investments" do
end
select "Health", from: "budget_investment_heading_id"
fill_in "budget_investment_title", with: "Build a park in my neighborhood"
fill_in "budget_investment_description", with: "There is no parks here..."
fill_in "Title", with: "Build a park in my neighborhood"
fill_in "Description", with: "There is no parks here..."
fill_in "budget_investment_location", with: "City center"
fill_in "budget_investment_organization_name", with: "T.I.A."
fill_in "budget_investment_tag_list", with: "green"

View File

@@ -67,8 +67,8 @@ describe "Tags" do
visit new_budget_investment_path(budget_id: budget.id)
select heading.name, from: "budget_investment_heading_id"
fill_in "budget_investment_title", with: "Build a skyscraper"
fill_in "budget_investment_description", with: "I want to live in a high tower over the clouds"
fill_in "Title", with: "Build a skyscraper"
fill_in "Description", with: "I want to live in a high tower over the clouds"
check "budget_investment_terms_of_service"
fill_in "budget_investment_tag_list", with: "#{tag_medio_ambiente.name}, #{tag_economia.name}"
@@ -86,8 +86,8 @@ describe "Tags" do
visit new_budget_investment_path(budget_id: budget.id)
select heading.name, from: "budget_investment_heading_id"
fill_in "budget_investment_title", with: "Build a skyscraper"
fill_in_ckeditor "budget_investment_description", with: "If I had a gym near my place I could go do Zumba"
fill_in "Title", with: "Build a skyscraper"
fill_in_ckeditor "Description", with: "If I had a gym near my place I could go do Zumba"
check "budget_investment_terms_of_service"
find(".js-add-tag-link", text: tag_economia.name).click
@@ -111,8 +111,8 @@ describe "Tags" do
click_link "Create a budget investment"
select heading.name, from: "budget_investment_heading_id"
fill_in "budget_investment_title", with: "Build a skyscraper"
fill_in_ckeditor "budget_investment_description", with: "If I had a gym near my place I could go do Zumba"
fill_in "Title", with: "Build a skyscraper"
fill_in_ckeditor "Description", with: "If I had a gym near my place I could go do Zumba"
check "budget_investment_terms_of_service"
find(".js-add-tag-link", text: "Education").click
@@ -136,8 +136,8 @@ describe "Tags" do
click_link "Create a budget investment"
select heading.name, from: "budget_investment_heading_id"
fill_in "budget_investment_title", with: "Build a skyscraper"
fill_in_ckeditor "budget_investment_description", with: "If I had a gym near my place I could go do Zumba"
fill_in "Title", with: "Build a skyscraper"
fill_in_ckeditor "Description", with: "If I had a gym near my place I could go do Zumba"
check "budget_investment_terms_of_service"
find(".js-add-tag-link", text: "Education").click
@@ -157,8 +157,8 @@ describe "Tags" do
visit new_budget_investment_path(budget_id: budget.id)
select heading.name, from: "budget_investment_heading_id"
fill_in "budget_investment_title", with: "Build a skyscraper"
fill_in "budget_investment_description", with: "I want to live in a high tower over the clouds"
fill_in "Title", with: "Build a skyscraper"
fill_in "Description", with: "I want to live in a high tower over the clouds"
check "budget_investment_terms_of_service"
fill_in "budget_investment_tag_list", with: "Impuestos, Economía, Hacienda, Sanidad, Educación, Política, Igualdad"
@@ -175,8 +175,8 @@ describe "Tags" do
visit new_budget_investment_path(budget_id: budget.id)
select heading.name, from: "budget_investment_heading_id"
fill_in "budget_investment_title", with: "Build a skyscraper"
fill_in "budget_investment_description", with: "I want to live in a high tower over the clouds"
fill_in "Title", with: "Build a skyscraper"
fill_in "Description", with: "I want to live in a high tower over the clouds"
check "budget_investment_terms_of_service"
fill_in "budget_investment_tag_list", with: "user_id=1, &a=3, <script>alert('hey');</script>"

View File

@@ -271,8 +271,8 @@ end
def fill_in_budget_investment_form
page.select mappable.heading.name_scoped_by_group, from: :budget_investment_heading_id
fill_in :budget_investment_title, with: "Budget investment title"
fill_in_ckeditor "budget_investment_description", with: "Budget investment description"
fill_in "Title", with: "Budget investment title"
fill_in_ckeditor "Description", with: "Budget investment description"
check :budget_investment_terms_of_service
end

View File

@@ -375,7 +375,7 @@ end
def documentable_fill_new_valid_budget_investment
page.select documentable.heading.name_scoped_by_group, from: :budget_investment_heading_id
fill_in :budget_investment_title, with: "Budget investment title"
fill_in_ckeditor "budget_investment_description", with: "Budget investment description"
fill_in "Title", with: "Budget investment title"
fill_in_ckeditor "Description", with: "Budget investment description"
check :budget_investment_terms_of_service
end

View File

@@ -296,8 +296,8 @@ end
def imageable_fill_new_valid_budget_investment
page.select imageable.heading.name_scoped_by_group, from: :budget_investment_heading_id
fill_in :budget_investment_title, with: "Budget investment title"
fill_in_ckeditor "budget_investment_description", with: "Budget investment description"
fill_in "Title", with: "Budget investment title"
fill_in_ckeditor "Description", with: "Budget investment description"
check :budget_investment_terms_of_service
end