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
177d36f7
Commit
177d36f7
authored
Mar 28, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EE] Reduce the diff with CE in spec/helpers/auth_helper_spec.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
9f7c4c70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
25 deletions
+38
-25
ee/spec/helpers/auth_helper_spec.rb
ee/spec/helpers/auth_helper_spec.rb
+36
-0
spec/helpers/auth_helper_spec.rb
spec/helpers/auth_helper_spec.rb
+2
-25
No files found.
ee/spec/helpers/auth_helper_spec.rb
0 → 100644
View file @
177d36f7
# frozen_string_literal: true
require
"spec_helper"
describe
AuthHelper
do
describe
"button_based_providers"
do
it
'excludes group_saml'
do
allow
(
helper
).
to
receive
(
:auth_providers
)
{
[
:group_saml
]
}
expect
(
helper
.
button_based_providers
).
to
eq
([])
end
end
describe
"providers_for_base_controller"
do
it
'excludes group_saml'
do
allow
(
helper
).
to
receive
(
:auth_providers
)
{
[
:group_saml
]
}
expect
(
helper
.
providers_for_base_controller
).
to
eq
([])
end
end
describe
"form_based_providers"
do
it
'includes kerberos provider'
do
allow
(
helper
).
to
receive
(
:auth_providers
)
{
[
:twitter
,
:kerberos
]
}
expect
(
helper
.
form_based_providers
).
to
eq
%i(kerberos)
end
end
describe
'form_based_auth_provider_has_active_class?'
do
it
'selects main LDAP server'
do
allow
(
helper
).
to
receive
(
:auth_providers
)
{
[
:twitter
,
:ldapprimary
,
:ldapsecondary
,
:kerberos
]
}
expect
(
helper
.
form_based_auth_provider_has_active_class?
(
:twitter
)).
to
be
(
false
)
expect
(
helper
.
form_based_auth_provider_has_active_class?
(
:ldapprimary
)).
to
be
(
true
)
expect
(
helper
.
form_based_auth_provider_has_active_class?
(
:ldapsecondary
)).
to
be
(
false
)
expect
(
helper
.
form_based_auth_provider_has_active_class?
(
:kerberos
)).
to
be
(
false
)
end
end
end
spec/helpers/auth_helper_spec.rb
View file @
177d36f7
# frozen_string_literal: true
require
"spec_helper"
describe
AuthHelper
do
...
...
@@ -12,11 +14,6 @@ describe AuthHelper do
expect
(
helper
.
button_based_providers
).
to
include
(
:twitter
)
end
it
'excludes group_saml'
do
allow
(
helper
).
to
receive
(
:auth_providers
)
{
[
:group_saml
]
}
expect
(
helper
.
button_based_providers
).
to
eq
([])
end
it
'returns empty array'
do
allow
(
helper
).
to
receive
(
:auth_providers
)
{
[]
}
expect
(
helper
.
button_based_providers
).
to
eq
([])
...
...
@@ -33,11 +30,6 @@ describe AuthHelper do
allow
(
helper
).
to
receive
(
:auth_providers
)
{
[
:twitter
,
:ldapmain
]
}
expect
(
helper
.
providers_for_base_controller
).
not_to
include
(
:ldapmain
)
end
it
'excludes group_saml'
do
allow
(
helper
).
to
receive
(
:auth_providers
)
{
[
:group_saml
]
}
expect
(
helper
.
providers_for_base_controller
).
to
eq
([])
end
end
describe
"form_based_providers"
do
...
...
@@ -50,21 +42,6 @@ describe AuthHelper do
allow
(
helper
).
to
receive
(
:auth_providers
)
{
[
:twitter
,
:crowd
]
}
expect
(
helper
.
form_based_providers
).
to
eq
%i(crowd)
end
it
'includes kerberos provider'
do
allow
(
helper
).
to
receive
(
:auth_providers
)
{
[
:twitter
,
:kerberos
]
}
expect
(
helper
.
form_based_providers
).
to
eq
%i(kerberos)
end
end
describe
'form_based_auth_provider_has_active_class?'
do
it
'selects main LDAP server'
do
allow
(
helper
).
to
receive
(
:auth_providers
)
{
[
:twitter
,
:ldapprimary
,
:ldapsecondary
,
:kerberos
]
}
expect
(
helper
.
form_based_auth_provider_has_active_class?
(
:twitter
)).
to
be
(
false
)
expect
(
helper
.
form_based_auth_provider_has_active_class?
(
:ldapprimary
)).
to
be
(
true
)
expect
(
helper
.
form_based_auth_provider_has_active_class?
(
:ldapsecondary
)).
to
be
(
false
)
expect
(
helper
.
form_based_auth_provider_has_active_class?
(
:kerberos
)).
to
be
(
false
)
end
end
describe
'form_based_auth_provider_has_active_class?'
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