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
Tatuya Kamada
gitlab-ce
Commits
b56b96d4
Commit
b56b96d4
authored
Dec 04, 2014
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added helper
parent
3a5ed526
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
app/helpers/oauth_helper.rb
app/helpers/oauth_helper.rb
+4
-0
app/views/devise/sessions/_oauth_providers.html.haml
app/views/devise/sessions/_oauth_providers.html.haml
+1
-1
spec/helpers/oauth_helper_spec.rb
spec/helpers/oauth_helper_spec.rb
+17
-0
No files found.
app/helpers/oauth_helper.rb
View file @
b56b96d4
...
...
@@ -16,4 +16,8 @@ module OauthHelper
[
:twitter
,
:github
,
:google_oauth2
].
include?
(
name
.
to_sym
)
end
end
def
additional_providers
enabled_oauth_providers
.
reject
{
|
provider
|
provider
.
to_s
.
starts_with?
(
'ldap'
)}
end
end
app/views/devise/sessions/_oauth_providers.html.haml
View file @
b56b96d4
-
providers
=
enabled_oauth_providers
.
reject
{
|
provider
|
provider
.
to_s
.
starts_with?
(
'ldap'
)}
-
providers
=
additional_providers
-
if
providers
.
present?
.bs-callout.bs-callout-info
{
:'data-no-turbolink'
=>
'data-no-turbolink'
}
%span
Sign in with:
...
...
spec/helpers/oauth_helper_spec.rb
0 → 100644
View file @
b56b96d4
require
"spec_helper"
describe
OauthHelper
do
describe
"additional_providers"
do
it
'returns appropriate values'
do
[
[[
:twitter
,
:github
],
[
:twitter
,
:github
]],
[[
:ldap_main
],
[]],
[[
:twitter
,
:ldap_main
],
[
:twitter
]],
[[],
[]],
].
each
do
|
couple
|
allow
(
helper
).
to
receive
(
:enabled_oauth_providers
)
{
couple
.
first
}
additional_providers
.
should
include
(
*
couple
.
last
)
end
end
end
end
\ No newline at end of file
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