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
Léo-Paul Géneau
gitlab-ce
Commits
f5937926
Commit
f5937926
authored
Sep 09, 2017
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored the Spinach feature `features/profile/emails.feature` into
an rspec feature
parent
86698c96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
spec/features/profiles/emails_spec.rb
spec/features/profiles/emails_spec.rb
+56
-0
No files found.
spec/features/profiles/emails_spec.rb
0 → 100644
View file @
f5937926
require
'rails_helper'
feature
'Profile > Emails'
do
let
(
:user
)
{
create
(
:user
)
}
before
do
login_as
(
user
)
end
describe
'User adds an email'
do
before
do
visit
profile_emails_path
end
scenario
'saves the new email'
do
fill_in
(
'Email'
,
with:
'my@email.com'
)
click_button
(
'Add email address'
)
expect
(
page
).
to
have_content
(
'my@email.com Unverified'
)
expect
(
page
).
to
have_content
(
'user1@example.org Verified'
)
expect
(
page
).
to
have_content
(
'Resend Confirmation Email'
)
end
scenario
'does not add a duplicate email'
do
fill_in
(
'Email'
,
with:
user
.
email
)
click_button
(
'Add email address'
)
email
=
user
.
emails
.
find_by
(
email:
user
.
email
)
expect
(
email
).
to
be_nil
expect
(
page
).
to
have_content
(
'Email has already been taken'
)
end
end
scenario
'User removes email'
do
user
.
emails
.
create
(
email:
'my@email.com'
)
visit
profile_emails_path
expect
(
page
).
to
have_content
(
"my@email.com"
)
click_link
(
'Remove'
)
expect
(
page
).
to_not
have_content
(
"my@email.com"
)
end
scenario
'User confirms email'
do
email
=
user
.
emails
.
create
(
email:
'my@email.com'
)
visit
profile_emails_path
expect
(
page
).
to
have_content
(
"my@email.com Unverified"
)
email
.
confirm
expect
(
email
.
confirmed?
).
to
be_truthy
visit
profile_emails_path
expect
(
page
).
to
have_content
(
"my@email.com Verified"
)
end
scenario
''
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