BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
11044ab1
Commit
11044ab1
authored
Jun 13, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spec
parent
5f0e7873
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
update_service_spec.rb
spec/services/users/update_service_spec.rb
+5
-6
No files found.
spec/services/users/update_service_spec.rb
View file @
11044ab1
...
...
@@ -3,7 +3,6 @@ require 'spec_helper'
describe
Users
::
UpdateService
,
services:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:user
)
{
create
(
:empty_user
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
}
describe
'#execute'
do
it
'updates the name'
do
...
...
@@ -14,20 +13,20 @@ describe Users::UpdateService, services: true do
context
'when updated by an admin'
do
it
'updates the name'
do
result
=
update_user
(
user
,
admin
,
name:
'New Name'
)
result
=
update_user
(
admin
,
user
,
name:
'New Name'
)
expect
(
result
).
to
eq
({
status: :success
})
expect
(
user
.
name
).
to
eq
(
'New Name'
)
end
end
it
'returns an error result when record cannot be updated'
do
result
=
update_user
(
user
,
create
(
:user
),
{
name:
'New Name'
})
e
xpect
(
result
).
to
eq
({
status: :error
,
message:
'User could not be updated'
})
expect
do
update_user
(
user
,
create
(
:user
),
{
name:
'New Name'
})
e
nd
.
to
raise_error
Gitlab
::
Access
::
AccessDeniedError
end
def
update_user
(
current_user
,
user
,
opts
)
described_class
.
new
(
user
,
user
,
opts
).
execute
described_class
.
new
(
current_
user
,
user
,
opts
).
execute
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