Fix debate specs
After adding debate 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:
committed by
voodoorai2000
parent
b67cd0fe40
commit
f77e7df33e
@@ -8,12 +8,12 @@ describe "CKEditor" do
|
||||
|
||||
visit new_debate_path
|
||||
|
||||
expect(page).to have_css "#cke_debate_description"
|
||||
expect(page).to have_css ".translatable-fields[data-locale='en'] .cke_wysiwyg_frame"
|
||||
|
||||
click_link "Debates"
|
||||
click_link "Start a debate"
|
||||
|
||||
expect(page).to have_css "#cke_debate_description"
|
||||
expect(page).to have_css ".translatable-fields[data-locale='en'] .cke_wysiwyg_frame"
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -169,8 +169,8 @@ describe "Debates" do
|
||||
login_as(author)
|
||||
|
||||
visit new_debate_path
|
||||
fill_in "debate_title", with: "A title for a debate"
|
||||
fill_in "debate_description", with: "This is very important because..."
|
||||
fill_in "Debate title", with: "A title for a debate"
|
||||
fill_in "Initial debate text", with: "This is very important because..."
|
||||
check "debate_terms_of_service"
|
||||
|
||||
click_button "Start a debate"
|
||||
@@ -187,9 +187,9 @@ describe "Debates" do
|
||||
login_as(author)
|
||||
|
||||
visit new_debate_path
|
||||
fill_in "debate_title", with: "I am a bot"
|
||||
fill_in "Debate title", with: "I am a bot"
|
||||
fill_in "debate_subtitle", with: "This is a honeypot field"
|
||||
fill_in "debate_description", with: "This is the description"
|
||||
fill_in "Initial debate text", with: "This is the description"
|
||||
check "debate_terms_of_service"
|
||||
|
||||
click_button "Start a debate"
|
||||
@@ -206,8 +206,8 @@ describe "Debates" do
|
||||
login_as(author)
|
||||
|
||||
visit new_debate_path
|
||||
fill_in "debate_title", with: "I am a bot"
|
||||
fill_in "debate_description", with: "This is the description"
|
||||
fill_in "Debate title", with: "I am a bot"
|
||||
fill_in "Initial debate text", with: "This is the description"
|
||||
check "debate_terms_of_service"
|
||||
|
||||
click_button "Start a debate"
|
||||
@@ -231,8 +231,8 @@ describe "Debates" do
|
||||
login_as(author)
|
||||
|
||||
visit new_debate_path
|
||||
fill_in "debate_title", with: "Testing an attack"
|
||||
fill_in "debate_description", with: "<p>This is <script>alert('an attack');</script></p>"
|
||||
fill_in "Debate title", with: "Testing an attack"
|
||||
fill_in "Initial debate text", with: "<p>This is <script>alert('an attack');</script></p>"
|
||||
check "debate_terms_of_service"
|
||||
|
||||
click_button "Start a debate"
|
||||
@@ -249,8 +249,8 @@ describe "Debates" do
|
||||
login_as(author)
|
||||
|
||||
visit new_debate_path
|
||||
fill_in "debate_title", with: "Testing auto link"
|
||||
fill_in "debate_description", with: "<p>This is a link www.example.org</p>"
|
||||
fill_in "Debate title", with: "Testing auto link"
|
||||
fill_in "Initial debate text", with: "<p>This is a link www.example.org</p>"
|
||||
check "debate_terms_of_service"
|
||||
|
||||
click_button "Start a debate"
|
||||
@@ -266,8 +266,8 @@ describe "Debates" do
|
||||
login_as(author)
|
||||
|
||||
visit new_debate_path
|
||||
fill_in "debate_title", with: "Testing auto link"
|
||||
fill_in "debate_description", with: js_injection_string
|
||||
fill_in "Debate title", with: "Testing auto link"
|
||||
fill_in "Initial debate text", with: js_injection_string
|
||||
check "debate_terms_of_service"
|
||||
|
||||
click_button "Start a debate"
|
||||
@@ -318,8 +318,8 @@ describe "Debates" do
|
||||
visit edit_debate_path(debate)
|
||||
expect(page).to have_current_path(edit_debate_path(debate))
|
||||
|
||||
fill_in "debate_title", with: "End child poverty"
|
||||
fill_in "debate_description", with: "Let's do something to end child poverty"
|
||||
fill_in "Debate title", with: "End child poverty"
|
||||
fill_in "Initial debate text", with: "Let's do something to end child poverty"
|
||||
|
||||
click_button "Save changes"
|
||||
|
||||
@@ -333,7 +333,7 @@ describe "Debates" do
|
||||
login_as(debate.author)
|
||||
|
||||
visit edit_debate_path(debate)
|
||||
fill_in "debate_title", with: ""
|
||||
fill_in "Debate title", with: ""
|
||||
click_button "Save changes"
|
||||
|
||||
expect(page).to have_content error_message
|
||||
@@ -1108,7 +1108,7 @@ describe "Debates" do
|
||||
debate7 = create(:debate, title: "This has seven votes, and is not suggest", description: "This is the seven", cached_votes_up: 7)
|
||||
|
||||
visit new_debate_path
|
||||
fill_in "debate_title", with: "debate"
|
||||
fill_in "Debate title", with: "debate"
|
||||
check "debate_terms_of_service"
|
||||
|
||||
within("div#js-suggest") do
|
||||
@@ -1124,7 +1124,7 @@ describe "Debates" do
|
||||
debate2 = create(:debate, title: "Second debate has 2 votes", cached_votes_up: 2)
|
||||
|
||||
visit new_debate_path
|
||||
fill_in "debate_title", with: "proposal"
|
||||
fill_in "Debate title", with: "proposal"
|
||||
check "debate_terms_of_service"
|
||||
|
||||
within("div#js-suggest") do
|
||||
|
||||
@@ -66,8 +66,8 @@ describe "Tags" do
|
||||
login_as(user)
|
||||
|
||||
visit new_debate_path
|
||||
fill_in "debate_title", with: "Title"
|
||||
fill_in "debate_description", with: "Description"
|
||||
fill_in "Debate title", with: "Title"
|
||||
fill_in "Initial debate text", with: "Description"
|
||||
check "debate_terms_of_service"
|
||||
|
||||
fill_in "debate_tag_list", with: "Impuestos, Economía, Hacienda"
|
||||
@@ -85,8 +85,8 @@ describe "Tags" do
|
||||
login_as(user)
|
||||
|
||||
visit new_debate_path
|
||||
fill_in "debate_title", with: "Title"
|
||||
fill_in "debate_description", with: "Description"
|
||||
fill_in "Debate title", with: "Title"
|
||||
fill_in "Initial debate text", with: "Description"
|
||||
check "debate_terms_of_service"
|
||||
|
||||
fill_in "debate_tag_list", with: "Impuestos, Economía, Hacienda, Sanidad, Educación, Política, Igualdad"
|
||||
@@ -103,8 +103,8 @@ describe "Tags" do
|
||||
|
||||
visit new_debate_path
|
||||
|
||||
fill_in "debate_title", with: "A test of dangerous strings"
|
||||
fill_in "debate_description", with: "A description suitable for this test"
|
||||
fill_in "Debate title", with: "A test of dangerous strings"
|
||||
fill_in "Initial debate text", with: "A description suitable for this test"
|
||||
check "debate_terms_of_service"
|
||||
|
||||
fill_in "debate_tag_list", with: "user_id=1, &a=3, <script>alert('hey');</script>"
|
||||
|
||||
@@ -59,8 +59,8 @@ describe "Tags" do
|
||||
login_as(user)
|
||||
|
||||
visit new_debate_path
|
||||
fill_in "debate_title", with: "Title"
|
||||
fill_in "debate_description", with: "Description"
|
||||
fill_in "Debate title", with: "Title"
|
||||
fill_in "Initial debate text", with: "Description"
|
||||
check "debate_terms_of_service"
|
||||
|
||||
fill_in "debate_tag_list", with: "Impuestos, Economía, Hacienda"
|
||||
@@ -78,8 +78,8 @@ describe "Tags" do
|
||||
login_as(user)
|
||||
|
||||
visit new_debate_path
|
||||
fill_in "debate_title", with: "Title"
|
||||
fill_in "debate_description", with: "Description"
|
||||
fill_in "Debate title", with: "Title"
|
||||
fill_in "Initial debate text", with: "Description"
|
||||
check "debate_terms_of_service"
|
||||
|
||||
fill_in "debate_tag_list", with: "Impuestos, Economía, Hacienda, Sanidad, Educación, Política, Igualdad"
|
||||
|
||||
Reference in New Issue
Block a user