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
Boxiang Sun
gitlab-ce
Commits
f346e212
Commit
f346e212
authored
Jul 31, 2019
by
Alex Buijs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some feature specs
parent
a0bbfa9f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
spec/features/users/login_spec.rb
spec/features/users/login_spec.rb
+35
-0
No files found.
spec/features/users/login_spec.rb
View file @
f346e212
...
@@ -745,4 +745,39 @@ describe 'Login' do
...
@@ -745,4 +745,39 @@ describe 'Login' do
end
end
end
end
end
end
context
'when sending confirmation email and not yet confirmed'
do
let!
(
:user
)
{
create
(
:user
,
confirmed_at:
nil
)
}
let
(
:grace_period
)
{
2
.
days
}
before
do
stub_application_setting
(
send_user_confirmation_email:
true
)
stub_feature_flags
(
soft_email_confirmation:
true
)
allow
(
User
).
to
receive
(
:allow_unconfirmed_access_for
).
and_return
grace_period
end
it
'allows login and shows a flash warning to confirm the email address'
do
expect
(
authentication_metrics
).
to
increment
(
:user_authenticated_counter
)
gitlab_sign_in
(
user
)
expect
(
current_path
).
to
eq
root_path
expect
(
page
).
to
have_content
(
"Please check your email (
#{
user
.
email
}
) to verify that you own this address."
)
end
context
"when not having confirmed within Devise's allow_unconfirmed_access_for time"
do
it
'does not allow login and shows a flash alert to confirm the email address'
do
travel_to
((
grace_period
+
1
.
day
).
from_now
)
do
expect
(
authentication_metrics
)
.
to
increment
(
:user_unauthenticated_counter
)
.
and
increment
(
:user_session_destroyed_counter
).
twice
gitlab_sign_in
(
user
)
expect
(
current_path
).
to
eq
new_user_session_path
expect
(
page
).
to
have_content
(
'You have to confirm your email address before continuing.'
)
end
end
end
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