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
a77dfc46
Commit
a77dfc46
authored
Jan 15, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary spec
parent
46997c6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
73 deletions
+0
-73
spec/contexts/issues/list_context_spec.rb
spec/contexts/issues/list_context_spec.rb
+0
-73
No files found.
spec/contexts/issues/list_context_spec.rb
deleted
100644 → 0
View file @
46997c6a
require
'spec_helper'
describe
Issues
::
ListContext
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
creator:
user
)
}
titles
=
[
'foo'
,
'bar'
,
'baz'
]
titles
.
each_with_index
do
|
title
,
index
|
let!
(
title
.
to_sym
)
{
create
(
:issue
,
title:
title
,
project:
project
,
created_at:
Time
.
now
-
(
index
*
60
))
}
end
describe
'sorting'
do
it
'sorts by newest'
do
params
=
{
sort:
'newest'
}
issues
=
Issues
::
ListContext
.
new
(
project
,
user
,
params
).
execute
issues
.
first
.
should
eq
foo
end
it
'sorts by oldest'
do
params
=
{
sort:
'oldest'
}
issues
=
Issues
::
ListContext
.
new
(
project
,
user
,
params
).
execute
issues
.
first
.
should
eq
baz
end
it
'sorts by recently updated'
do
params
=
{
sort:
'recently_updated'
}
baz
.
updated_at
=
Time
.
now
+
10
baz
.
save
issues
=
Issues
::
ListContext
.
new
(
project
,
user
,
params
).
execute
issues
.
first
.
should
eq
baz
end
it
'sorts by least recently updated'
do
params
=
{
sort:
'last_updated'
}
bar
.
updated_at
=
Time
.
now
-
10
bar
.
save
issues
=
Issues
::
ListContext
.
new
(
project
,
user
,
params
).
execute
issues
.
first
.
should
eq
bar
end
describe
'sorting by milestone'
do
let
(
:newer_due_milestone
)
{
create
(
:milestone
,
due_date:
'2013-12-11'
)
}
let
(
:later_due_milestone
)
{
create
(
:milestone
,
due_date:
'2013-12-12'
)
}
before
:each
do
foo
.
milestone
=
newer_due_milestone
foo
.
save
bar
.
milestone
=
later_due_milestone
bar
.
save
end
it
'sorts by most recently due milestone'
do
params
=
{
sort:
'milestone_due_soon'
}
issues
=
Issues
::
ListContext
.
new
(
project
,
user
,
params
).
execute
issues
.
first
.
should
eq
foo
end
it
'sorts by least recently due milestone'
do
params
=
{
sort:
'milestone_due_later'
}
issues
=
Issues
::
ListContext
.
new
(
project
,
user
,
params
).
execute
issues
.
first
.
should
eq
bar
end
end
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