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
9e8238d9
Commit
9e8238d9
authored
Mar 24, 2020
by
Lucas Charles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
De-duplicate auth helper EE specs
Part of
https://gitlab.com/gitlab-org/gitlab/-/issues/211887
parent
68d82ed0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
38 deletions
+31
-38
.rubocop.yml
.rubocop.yml
+0
-2
ee/spec/helpers/auth_helper_spec.rb
ee/spec/helpers/auth_helper_spec.rb
+0
-36
ee/spec/helpers/ee/auth_helper_spec.rb
ee/spec/helpers/ee/auth_helper_spec.rb
+31
-0
No files found.
.rubocop.yml
View file @
9e8238d9
...
...
@@ -221,10 +221,8 @@ GitlabSecurity/PublicSend:
Gitlab/DuplicateSpecLocation
:
Exclude
:
-
ee/spec/helpers/auth_helper_spec.rb
-
ee/spec/lib/gitlab/gl_repository_spec.rb
-
ee/spec/services/merge_requests/refresh_service_spec.rb
-
ee/spec/helpers/ee/auth_helper_spec.rb
-
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
Cop/InjectEnterpriseEditionModule
:
...
...
ee/spec/helpers/auth_helper_spec.rb
deleted
100644 → 0
View file @
68d82ed0
# 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
ee/spec/helpers/ee/auth_helper_spec.rb
View file @
9e8238d9
...
...
@@ -3,6 +3,37 @@
require
'spec_helper'
describe
EE
::
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
describe
"form_based_providers"
do
context
'with smartcard_auth feature flag off'
do
before
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