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
cd04894e
Commit
cd04894e
authored
Feb 25, 2020
by
Małgorzata Ksionek
Committed by
Luca Leonardo Scorcia
Mar 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs to auth helper
parent
efcb6a0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
spec/helpers/auth_helper_spec.rb
spec/helpers/auth_helper_spec.rb
+30
-0
No files found.
spec/helpers/auth_helper_spec.rb
View file @
cd04894e
...
...
@@ -154,4 +154,34 @@ describe AuthHelper do
expect
(
helper
.
unlink_provider_allowed?
(
provider
)).
to
eq
'policy_unlink_result'
end
end
describe
'#provider_has_icon?'
do
it
'returns true for defined providers'
do
expect
(
helper
.
provider_has_icon?
(
described_class
::
PROVIDERS_WITH_ICONS
.
sample
)).
to
eq
true
end
it
'returns false for undefined providers'
do
expect
(
helper
.
provider_has_icon?
(
'test'
)).
to
be_falsey
end
context
'when provider is defined by config'
do
before
do
allow
(
Gitlab
::
Auth
::
OAuth
::
Provider
).
to
receive
(
:icon_for
).
with
(
'test'
).
and_return
(
'icon'
)
end
it
'returns true'
do
expect
(
helper
.
provider_has_icon?
(
'test'
)).
to
be_truthy
end
end
context
'when provider is not defined by config'
do
before
do
allow
(
Gitlab
::
Auth
::
OAuth
::
Provider
).
to
receive
(
:icon_for
).
with
(
'test'
).
and_return
(
nil
)
end
it
'returns true'
do
expect
(
helper
.
provider_has_icon?
(
'test'
)).
to
be_falsey
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