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
efb3d5e7
Commit
efb3d5e7
authored
Jun 23, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spec failures
parent
b33c6384
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
6 deletions
+4
-6
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+1
-1
app/controllers/profiles/two_factor_auths_controller.rb
app/controllers/profiles/two_factor_auths_controller.rb
+1
-3
spec/services/emails/create_service_spec.rb
spec/services/emails/create_service_spec.rb
+1
-1
spec/services/emails/destroy_service_spec.rb
spec/services/emails/destroy_service_spec.rb
+1
-1
No files found.
app/controllers/admin/users_controller.rb
View file @
efb3d5e7
...
@@ -152,7 +152,7 @@ class Admin::UsersController < Admin::ApplicationController
...
@@ -152,7 +152,7 @@ class Admin::UsersController < Admin::ApplicationController
def
remove_email
def
remove_email
email
=
user
.
emails
.
find
(
params
[
:email_id
])
email
=
user
.
emails
.
find
(
params
[
:email_id
])
success
=
Emails
::
DestroyService
.
new
(
current_user
,
user
,
email:
email
.
email
).
execute
success
=
Emails
::
DestroyService
.
new
(
user
,
email:
email
.
email
).
execute
respond_to
do
|
format
|
respond_to
do
|
format
|
if
success
if
success
...
...
app/controllers/profiles/two_factor_auths_controller.rb
View file @
efb3d5e7
...
@@ -41,10 +41,8 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
...
@@ -41,10 +41,8 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
def
create
def
create
if
current_user
.
validate_and_consume_otp!
(
params
[
:pin_code
])
if
current_user
.
validate_and_consume_otp!
(
params
[
:pin_code
])
codes
=
nil
Users
::
UpdateService
.
new
(
current_user
,
otp_required_for_login:
true
).
execute!
do
|
user
|
Users
::
UpdateService
.
new
(
current_user
,
otp_required_for_login:
true
).
execute!
do
|
user
|
codes
=
user
.
generate_otp_backup_codes!
@
codes
=
user
.
generate_otp_backup_codes!
end
end
render
'create'
render
'create'
...
...
spec/services/emails/create_service_spec.rb
View file @
efb3d5e7
...
@@ -4,7 +4,7 @@ describe Emails::CreateService, services: true do
...
@@ -4,7 +4,7 @@ describe Emails::CreateService, services: true do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:opts
)
{
{
email:
'new@email.com'
}
}
let
(
:opts
)
{
{
email:
'new@email.com'
}
}
subject
(
:service
)
{
described_class
.
new
(
user
,
user
,
opts
)
}
subject
(
:service
)
{
described_class
.
new
(
user
,
opts
)
}
describe
'#execute'
do
describe
'#execute'
do
it
'creates an email with valid attributes'
do
it
'creates an email with valid attributes'
do
...
...
spec/services/emails/destroy_service_spec.rb
View file @
efb3d5e7
...
@@ -4,7 +4,7 @@ describe Emails::DestroyService, services: true do
...
@@ -4,7 +4,7 @@ describe Emails::DestroyService, services: true do
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:email
)
{
create
(
:email
,
user:
user
)
}
let!
(
:email
)
{
create
(
:email
,
user:
user
)
}
subject
(
:service
)
{
described_class
.
new
(
user
,
user
,
email:
email
.
email
)
}
subject
(
:service
)
{
described_class
.
new
(
user
,
email:
email
.
email
)
}
describe
'#execute'
do
describe
'#execute'
do
it
'removes an email'
do
it
'removes an email'
do
...
...
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