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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
a09e572b
Commit
a09e572b
authored
Feb 11, 2019
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add user auth spec
parent
323e64ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
ee/spec/lib/gitlab/auth/user_auth_finders_spec.rb
ee/spec/lib/gitlab/auth/user_auth_finders_spec.rb
+21
-0
No files found.
ee/spec/lib/gitlab/auth/user_auth_finders_spec.rb
View file @
a09e572b
...
...
@@ -64,4 +64,25 @@ describe Gitlab::Auth::UserAuthFinders do
it_behaves_like
'find user from job token'
end
end
describe
'#find_user_from_scim_token'
do
let
(
:token
)
{
create
(
:personal_access_token
,
user:
user
)
}
before
do
allow
(
request
).
to
receive
(
:path
).
and_return
(
'/api/scim/'
)
allow
(
self
).
to
receive
(
:current_request
).
and_return
(
request
)
end
it
"returns an Unauthorized exception for an invalid token"
do
env
[
'HTTP_AUTHORIZATION'
]
=
"Bearer invalid"
expect
{
find_user_from_scim_token
}.
to
raise_error
(
Gitlab
::
Auth
::
UnauthorizedError
)
end
it
"return user if token is valid"
do
env
[
'HTTP_AUTHORIZATION'
]
=
"Bearer
#{
token
.
token
}
"
expect
(
find_user_from_scim_token
).
to
eq
(
user
)
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