Skip to content

Commit

Permalink
Fixes failing signup system test on travis (#8461)
Browse files Browse the repository at this point in the history
* assert correct request url

* check validation text

* check the flash includes spam detection exception

* assert full spam detection text

* remove assertions
  • Loading branch information
cesswairimu committed Oct 6, 2020
1 parent bb75633 commit c150b5b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test/system/signup_form_test.rb
Original file line number Diff line number Diff line change
@@ -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: "[email protected]")
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: "[email protected]")
fill_in("password1", with: "secretive")
fill_in("password-confirmation", with: "secretive")
#Checks if submit button is enabled
find_button("signup-button")
end
end

0 comments on commit c150b5b

Please sign in to comment.