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
1118a6fd
Commit
1118a6fd
authored
Aug 06, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a spec for User#requires_ldap_check?
parent
82dc4093
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
spec/models/user_spec.rb
spec/models/user_spec.rb
+23
-0
No files found.
spec/models/user_spec.rb
View file @
1118a6fd
...
...
@@ -312,6 +312,29 @@ describe User do
end
end
describe
:requires_ldap_check?
do
let
(
:user
)
{
User
.
new
}
it
'is false for non-LDAP users'
do
user
.
stub
(
ldap_user?:
false
)
expect
(
user
.
requires_ldap_check?
).
to
be_false
end
context
'when the user is an LDAP user'
do
before
{
user
.
stub
(
ldap_user?:
true
)
}
it
'is true when the user has never had an LDAP check before'
do
user
.
last_credential_check_at
=
nil
expect
(
user
.
requires_ldap_check?
).
to
be_true
end
it
'is true when the last LDAP check happened over 1 hour ago'
do
user
.
last_credential_check_at
=
2
.
hours
.
ago
expect
(
user
.
requires_ldap_check?
).
to
be_true
end
end
end
describe
'#full_website_url'
do
let
(
:user
)
{
create
(
:user
)
}
...
...
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