forked from publiclab/plots2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signup form validation (publiclab#7768)
* fixes signup form validation on page reload * adds system test
- Loading branch information
1 parent
d4d266e
commit f5538f0
Showing
3 changed files
with
61 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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, "/register" | ||
#Searches for error | ||
assert_selector("#error-message #errorExplanation", text: "Email") | ||
|
||
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 |