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.
# This is a combination of 3 commits.
# This is the 1st commit message: Added email signup test Fixed spamaway shortcircuiting Renamed signup_flow file and fixed grammar Added email signup test Renamed signup_flow file and fixed grammar Fixed spamaway shortcircuiting Added email signup test Renamed signup_flow file and fixed grammar Added email signup test Renamed signup_flow file and fixed grammar Undid changes to users controller Fixed travis build error Fixed travis build errors # This is the commit message publiclab#2: Added email signup test # This is the commit message publiclab#3: Fixed spamaway shortcircuiting
- Loading branch information
1 parent
9f0d400
commit 7f14c7f
Showing
3 changed files
with
67 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require 'test_helper' | ||
|
||
|
||
class SignUpTest < ActionDispatch::IntegrationTest | ||
def setup | ||
@new_user = { | ||
:username => "newuser", | ||
:email => "newuser@gmail.com", | ||
:password => "validpassword" | ||
} | ||
end | ||
|
||
test 'display email error messages' do | ||
post '/register', params: { | ||
user: { | ||
username: @new_user[:username], | ||
email: 'notanemail', | ||
password: @new_user[:password], | ||
password_confirmation: @new_user[:password], | ||
}, | ||
spamaway: { | ||
statement1: I18n.t('spamaway.human.statement1'), | ||
statement2: I18n.t('spamaway.human.statement1'), | ||
statement3: I18n.t('spamaway.human.statement1'), | ||
statement4: I18n.t('spamaway.human.statement1') | ||
} | ||
} | ||
|
||
# assert response.body.include? '1 error prohibited this user from being saved' | ||
assert response.body.include? 'Email should look like an email address.' | ||
end | ||
end |
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,32 @@ | ||
re 'test_helper' | ||
|
||
|
||
class SignUpTest < ActionDispatch::IntegrationTest | ||
def setup | ||
@new_user = { | ||
:username => "newuser", | ||
:email => "newuser@gmail.com", | ||
:password => "validpassword" | ||
} | ||
end | ||
|
||
test 'email error messages' do | ||
post '/register', params: { | ||
user: { | ||
username: @new_user[:username], | ||
email: 'notanemail', | ||
password: @new_user[:password], | ||
password_confirmation: @new_user[:password], | ||
}, | ||
spamaway: { | ||
statement1: I18n.t('spamaway.human.statement1'), | ||
statement2: I18n.t('spamaway.human.statement1'), | ||
statement3: I18n.t('spamaway.human.statement1'), | ||
statement4: I18n.t('spamaway.human.statement1') | ||
} | ||
} | ||
|
||
assert response.body.include? '1 errors prohibited this user from being saved' | ||
assert response.body.include? 'Email should look like an email address.' | ||
end | ||
end |