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
f9a730eb
Commit
f9a730eb
authored
Dec 04, 2014
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix specs
parent
b56b96d4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
13 deletions
+16
-13
spec/helpers/oauth_helper_spec.rb
spec/helpers/oauth_helper_spec.rb
+13
-10
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+1
-1
spec/lib/gitlab/ldap/authentication_spec.rb
spec/lib/gitlab/ldap/authentication_spec.rb
+1
-1
spec/lib/gitlab/ldap/user_spec.rb
spec/lib/gitlab/ldap/user_spec.rb
+1
-1
No files found.
spec/helpers/oauth_helper_spec.rb
View file @
f9a730eb
...
@@ -2,16 +2,19 @@ require "spec_helper"
...
@@ -2,16 +2,19 @@ require "spec_helper"
describe
OauthHelper
do
describe
OauthHelper
do
describe
"additional_providers"
do
describe
"additional_providers"
do
it
'returns appropriate values'
do
it
'returns all enabled providers'
do
[
allow
(
helper
).
to
receive
(
:enabled_oauth_providers
)
{
[
:twitter
,
:github
]
}
[[
:twitter
,
:github
],
[
:twitter
,
:github
]],
helper
.
additional_providers
.
should
include
(
*
[
:twitter
,
:github
])
[[
:ldap_main
],
[]],
end
[[
:twitter
,
:ldap_main
],
[
:twitter
]],
[[],
[]],
it
'does not return ldap provider'
do
].
each
do
|
couple
|
allow
(
helper
).
to
receive
(
:enabled_oauth_providers
)
{
[
:twitter
,
:ldapmain
]
}
allow
(
helper
).
to
receive
(
:enabled_oauth_providers
)
{
couple
.
first
}
helper
.
additional_providers
.
should
include
(
:twitter
)
additional_providers
.
should
include
(
*
couple
.
last
)
end
end
it
'returns empty array'
do
allow
(
helper
).
to
receive
(
:enabled_oauth_providers
)
{
[]
}
helper
.
additional_providers
.
should
==
[]
end
end
end
end
end
end
\ No newline at end of file
spec/lib/gitlab/ldap/access_spec.rb
View file @
f9a730eb
...
@@ -2,7 +2,7 @@ require 'spec_helper'
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Gitlab
::
LDAP
::
Access
do
describe
Gitlab
::
LDAP
::
Access
do
let
(
:access
)
{
Gitlab
::
LDAP
::
Access
.
new
user
}
let
(
:access
)
{
Gitlab
::
LDAP
::
Access
.
new
user
}
let
(
:user
)
{
create
(
:
user
,
:ldap
)
}
let
(
:user
)
{
create
(
:
omniauth_user
)
}
describe
:allowed?
do
describe
:allowed?
do
subject
{
access
.
allowed?
}
subject
{
access
.
allowed?
}
...
...
spec/lib/gitlab/ldap/authentication_spec.rb
View file @
f9a730eb
...
@@ -2,7 +2,7 @@ require 'spec_helper'
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Gitlab
::
LDAP
::
Authentication
do
describe
Gitlab
::
LDAP
::
Authentication
do
let
(
:klass
)
{
Gitlab
::
LDAP
::
Authentication
}
let
(
:klass
)
{
Gitlab
::
LDAP
::
Authentication
}
let
(
:user
)
{
create
(
:
user
,
:ldap
,
extern_uid:
dn
)
}
let
(
:user
)
{
create
(
:
omniauth_user
,
extern_uid:
dn
)
}
let
(
:dn
)
{
'uid=john,ou=people,dc=example,dc=com'
}
let
(
:dn
)
{
'uid=john,ou=people,dc=example,dc=com'
}
let
(
:login
)
{
'john'
}
let
(
:login
)
{
'john'
}
let
(
:password
)
{
'password'
}
let
(
:password
)
{
'password'
}
...
...
spec/lib/gitlab/ldap/user_spec.rb
View file @
f9a730eb
...
@@ -21,7 +21,7 @@ describe Gitlab::LDAP::User do
...
@@ -21,7 +21,7 @@ describe Gitlab::LDAP::User do
end
end
it
"connects to existing non-ldap user if the email matches"
do
it
"connects to existing non-ldap user if the email matches"
do
existing_user
=
create
(
:omniauth_user
,
email:
'john@example.com'
)
existing_user
=
create
(
:omniauth_user
,
email:
'john@example.com'
,
provider:
"twitter"
)
expect
{
gl_user
.
save
}.
to_not
change
{
User
.
count
}
expect
{
gl_user
.
save
}.
to_not
change
{
User
.
count
}
existing_user
.
reload
existing_user
.
reload
...
...
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