Fix proposal specs

After adding proposal 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:26:39 +01:00
committed by voodoorai2000
parent dd310f7507
commit 78c2f54c5d
7 changed files with 61 additions and 61 deletions

View File

@@ -147,7 +147,7 @@ shared_examples "mappable" do |mappable_factory_name,
do_login_for mappable.author
visit send(mappable_edit_path, id: mappable.id)
fill_in "#{mappable_factory_name}_title", with: "New title"
fill_in "#{mappable_factory_name.camelize} title", with: "New title"
click_on("Save changes")
mappable.reload
@@ -172,7 +172,7 @@ shared_examples "mappable" do |mappable_factory_name,
do_login_for mappable.author
visit send(mappable_edit_path, id: mappable.id)
fill_in "#{mappable_factory_name}_title", with: "New title"
fill_in "#{mappable_factory_name.camelize} title", with: "New title"
click_on("Save changes")
expect(page).not_to have_css(".map_location")
@@ -249,8 +249,8 @@ def do_login_for(user)
end
def fill_in_proposal_form
fill_in "proposal_title", with: "Help refugees"
fill_in "proposal_summary", with: "In summary, what we want is..."
fill_in "Proposal title", with: "Help refugees"
fill_in "Proposal summary", with: "In summary, what we want is..."
end
def submit_proposal_form

View File

@@ -363,8 +363,8 @@ def expect_document_has_cached_attachment(index, extension)
end
def documentable_fill_new_valid_proposal
fill_in :proposal_title, with: "Proposal title #{rand(9999)}"
fill_in :proposal_summary, with: "Proposal summary"
fill_in "Proposal title", with: "Proposal title #{rand(9999)}"
fill_in "Proposal summary", with: "Proposal summary"
check :proposal_terms_of_service
end

View File

@@ -289,8 +289,8 @@ def imageable_attach_new_file(_imageable_factory_name, path, success = true)
end
def imageable_fill_new_valid_proposal
fill_in :proposal_title, with: "Proposal title"
fill_in :proposal_summary, with: "Proposal summary"
fill_in "Proposal title", with: "Proposal title"
fill_in "Proposal summary", with: "Proposal summary"
check :proposal_terms_of_service
end