Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
d18e0c179ee9
Commit
1149af15
authored
Sep 05, 2018
by
Sean McGivern
Browse files
Add spec for group issues search + sorting
parent
a267abeb08cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
spec/controllers/groups_controller_spec.rb
View file @
d18e0c17
...
@@ -202,8 +202,8 @@
...
@@ -202,8 +202,8 @@
end
end
describe
'GET #issues'
do
describe
'GET #issues'
do
let
(
:issue_1
)
{
create
(
:issue
,
project:
project
)
}
let
(
:issue_1
)
{
create
(
:issue
,
project:
project
,
title:
'foo'
)
}
let
(
:issue_2
)
{
create
(
:issue
,
project:
project
)
}
let
(
:issue_2
)
{
create
(
:issue
,
project:
project
,
title:
'bar'
)
}
before
do
before
do
create_list
(
:award_emoji
,
3
,
awardable:
issue_2
)
create_list
(
:award_emoji
,
3
,
awardable:
issue_2
)
...
@@ -224,6 +224,26 @@
...
@@ -224,6 +224,26 @@
expect
(
assigns
(
:issues
)).
to
eq
[
issue_2
,
issue_1
]
expect
(
assigns
(
:issues
)).
to
eq
[
issue_2
,
issue_1
]
end
end
end
end
context
'searching'
do
it
'works with popularity sort'
do
get
:issues
,
id:
group
.
to_param
,
search:
'foo'
,
sort:
'popularity'
expect
(
assigns
(
:issues
)).
to
eq
([
issue_1
])
end
it
'works with priority sort'
do
get
:issues
,
id:
group
.
to_param
,
search:
'foo'
,
sort:
'priority'
expect
(
assigns
(
:issues
)).
to
eq
([
issue_1
])
end
it
'works with label priority sort'
do
get
:issues
,
id:
group
.
to_param
,
search:
'foo'
,
sort:
'label_priority'
expect
(
assigns
(
:issues
)).
to
eq
([
issue_1
])
end
end
end
end
describe
'GET #merge_requests'
do
describe
'GET #merge_requests'
do
...
...
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