BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
a2f8f9ad
Commit
a2f8f9ad
authored
Nov 03, 2015
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed User sorting specs
The descriptions were not accurate and one particular spec seemingly expected the wrong User row to be returned.
parent
732f5380
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
user_spec.rb
spec/models/user_spec.rb
+6
-6
No files found.
spec/models/user_spec.rb
View file @
a2f8f9ad
...
...
@@ -663,24 +663,24 @@ describe User do
@user1
=
create
:user
,
created_at:
Date
.
today
-
1
,
last_sign_in_at:
Date
.
today
-
1
,
name:
'Omega'
end
it
"sorts users
as recently_signed_in
"
do
it
"sorts users
by the recent sign-in time
"
do
expect
(
User
.
sort
(
'recent_sign_in'
).
first
).
to
eq
(
@user
)
end
it
"sorts users
as late_signed_in
"
do
it
"sorts users
by the oldest sign-in time
"
do
expect
(
User
.
sort
(
'oldest_sign_in'
).
first
).
to
eq
(
@user1
)
end
it
"sorts users
as recently_created
"
do
it
"sorts users
in descending order by their creation time
"
do
expect
(
User
.
sort
(
'created_desc'
).
first
).
to
eq
(
@user
)
end
it
"sorts users
as late_created
"
do
it
"sorts users
in ascending order by their creation time
"
do
expect
(
User
.
sort
(
'created_asc'
).
first
).
to
eq
(
@user1
)
end
it
"sorts users by
name
when nil is passed"
do
expect
(
User
.
sort
(
nil
).
first
).
to
eq
(
@user
)
it
"sorts users by
id in descending order
when nil is passed"
do
expect
(
User
.
sort
(
nil
).
first
).
to
eq
(
@user
1
)
end
end
...
...
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