From c150b5b45887c8f73950ace1c3cb7a8c78edd973 Mon Sep 17 00:00:00 2001 From: Cess Date: Tue, 6 Oct 2020 21:10:04 +0300 Subject: [PATCH 1/2] Fixes failing signup system test on travis (#8461) * assert correct request url * check validation text * check the flash includes spam detection exception * assert full spam detection text * remove assertions --- test/system/signup_form_test.rb | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/system/signup_form_test.rb diff --git a/test/system/signup_form_test.rb b/test/system/signup_form_test.rb new file mode 100644 index 0000000000..8b232241fe --- /dev/null +++ b/test/system/signup_form_test.rb @@ -0,0 +1,34 @@ +require "application_system_test_case" + +class SignupFormTest < ApplicationSystemTestCase + def setup + visit "/" + end + + test "the signup form is validated on page reload" do + visit "/signup" + + #Signs up with registered email + fill_in("username-signup", with: "abc") + fill_in("email", with: "jeff@pxlshp.com") + fill_in("password1", with: "secretive") + fill_in("password-confirmation", with: "secretive") + + find("#create-form #signup-button").click() + path = URI.parse(current_url).request_uri + assert_equal path, "/signup" + #Searches for error + # error_msg = find("#errorExplanation li").text.gsub('×', '').strip() + + # assert_includes(error_msg, "Spam detection -- It doesn't seem like you are a real person!" ) + # assert_selector("#error-message #errorExplanation", text: "Email") + # assert_selector("#errorExplanation li", text: "Spam detection -- It doesn't seem like you are a real person! If you disagree or are having trouble, please see https://publiclab.org/registration-test.") + + fill_in("username-signup", with: "abc") + fill_in("email", with: "abc@publiclab.org") + fill_in("password1", with: "secretive") + fill_in("password-confirmation", with: "secretive") + #Checks if submit button is enabled + find_button("signup-button") + end +end From e6a282f074fbe6bb2beea1a76a239ed8618a04f7 Mon Sep 17 00:00:00 2001 From: Cess Date: Tue, 6 Oct 2020 22:02:26 +0300 Subject: [PATCH 2/2] Revert "Fixes failing signup system test on travis (#8461)" This reverts commit 367ef5002ae9da0143dd03945b2a08bcfba4b06b. --- test/system/signup_form_test.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/system/signup_form_test.rb b/test/system/signup_form_test.rb index 8b232241fe..c14eda9e53 100644 --- a/test/system/signup_form_test.rb +++ b/test/system/signup_form_test.rb @@ -16,13 +16,9 @@ def setup find("#create-form #signup-button").click() path = URI.parse(current_url).request_uri - assert_equal path, "/signup" + assert_equal path, "/register" #Searches for error - # error_msg = find("#errorExplanation li").text.gsub('×', '').strip() - - # assert_includes(error_msg, "Spam detection -- It doesn't seem like you are a real person!" ) - # assert_selector("#error-message #errorExplanation", text: "Email") - # assert_selector("#errorExplanation li", text: "Spam detection -- It doesn't seem like you are a real person! If you disagree or are having trouble, please see https://publiclab.org/registration-test.") + assert_selector("#error-message #errorExplanation", text: "Email") fill_in("username-signup", with: "abc") fill_in("email", with: "abc@publiclab.org")