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
Boxiang Sun
gitlab-ce
Commits
961d8793
Commit
961d8793
authored
Mar 26, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the tests for user search.
parent
2e94f0d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
spec/models/user_spec.rb
spec/models/user_spec.rb
+12
-0
No files found.
spec/models/user_spec.rb
View file @
961d8793
...
...
@@ -292,6 +292,18 @@ describe User do
end
end
describe
'search'
do
let
(
:user1
)
{
create
(
:user
,
username:
'James'
,
email:
'james@testing.com'
)
}
let
(
:user2
)
{
create
(
:user
,
username:
'jameson'
,
email:
'jameson@example.com'
)
}
it
"should be case insensitive"
do
User
.
search
(
user1
.
username
.
upcase
).
to_a
.
should
==
[
user1
]
User
.
search
(
user1
.
username
.
downcase
).
to_a
.
should
==
[
user1
]
User
.
search
(
user2
.
username
.
upcase
).
to_a
.
should
==
[
user2
]
User
.
search
(
user2
.
username
.
downcase
).
to_a
.
should
==
[
user2
]
end
end
describe
'by_username_or_id'
do
let
(
:user1
)
{
create
(
:user
,
username:
'foo'
)
}
...
...
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