Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
40bc8e76
Commit
40bc8e76
authored
Apr 18, 2016
by
Timothy Andrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add acceptance test to check if the user password persists after form redisplays.
- While signing up.
parent
ed1be100
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
spec/features/signup_spec.rb
spec/features/signup_spec.rb
+55
-0
No files found.
spec/features/signup_spec.rb
0 → 100644
View file @
40bc8e76
require
'spec_helper'
feature
'Signup'
,
feature:
true
do
describe
'signup with no errors'
do
it
'creates the user account and sends a confirmation email'
do
user
=
build
(
:user
)
visit
root_path
fill_in
'user_name'
,
with:
user
.
name
fill_in
'user_username'
,
with:
user
.
username
fill_in
'user_email'
,
with:
user
.
email
fill_in
'user_password_sign_up'
,
with:
user
.
password
click_button
"Sign up"
expect
(
current_path
).
to
eq
user_session_path
expect
(
page
).
to
have_content
(
"A message with a confirmation link has been sent to your email address."
)
end
end
describe
'signup with errors'
do
it
"displays the errors"
do
existing_user
=
create
(
:user
)
user
=
build
(
:user
)
visit
root_path
fill_in
'user_name'
,
with:
user
.
name
fill_in
'user_username'
,
with:
user
.
username
fill_in
'user_email'
,
with:
existing_user
.
email
fill_in
'user_password_sign_up'
,
with:
user
.
password
click_button
"Sign up"
expect
(
current_path
).
to
eq
user_registration_path
expect
(
page
).
to
have_content
(
"error prohibited this user from being saved"
)
expect
(
page
).
to
have_content
(
"Email has already been taken"
)
end
it
'does not redisplay the password'
do
existing_user
=
create
(
:user
)
user
=
build
(
:user
)
visit
root_path
fill_in
'user_name'
,
with:
user
.
name
fill_in
'user_username'
,
with:
user
.
username
fill_in
'user_email'
,
with:
existing_user
.
email
fill_in
'user_password_sign_up'
,
with:
user
.
password
click_button
"Sign up"
expect
(
current_path
).
to
eq
user_registration_path
expect
(
page
.
body
).
not_to
match
(
/
#{
user
.
password
}
/
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment