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
91296aff
Commit
91296aff
authored
Oct 07, 2016
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue CSV ignores pagination
parent
1a56196b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+7
-4
spec/features/issues/csv_spec.rb
spec/features/issues/csv_spec.rb
+12
-1
No files found.
app/controllers/projects/issues_controller.rb
View file @
91296aff
...
...
@@ -25,12 +25,15 @@ class Projects::IssuesController < Projects::ApplicationController
def
index
@collection_type
=
"Issue"
@issues
=
issues_collection
if
!
request
.
format
.
csv?
@issues
=
@issues
.
page
(
params
[
:page
])
@issuable_meta_data
=
issuable_meta_data
(
@issues
)
if
@issues
.
out_of_range?
&&
@issues
.
total_pages
!=
0
return
redirect_to
url_for
(
params
.
merge
(
page:
@issues
.
total_pages
))
end
end
if
params
[
:label_name
].
present?
@labels
=
LabelsFinder
.
new
(
current_user
,
project_id:
@project
.
id
,
title:
params
[
:label_name
]).
execute
...
...
spec/features/issues/csv_spec.rb
View file @
91296aff
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
'Issues csv'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:public
)
}
let!
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
before
{
login_as
(
user
)
}
...
...
@@ -10,9 +10,19 @@ describe 'Issues csv', feature: true do
it
"downloads from a project's issue index"
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
click_on
'Download CSV'
expect
(
page
.
response_headers
[
'Content-Type'
]).
to
include
(
'csv'
)
end
it
'ignores pagination'
do
create_list
(
:issue
,
30
,
project:
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
click_on
'Download CSV'
expect
(
csv
.
count
).
to
eq
31
end
context
'includes'
do
let
(
:label1
)
{
create
(
:label
,
project:
project
,
title:
'Feature'
)
}
let
(
:label2
)
{
create
(
:label
,
project:
project
,
title:
'labels'
)
}
...
...
@@ -55,6 +65,7 @@ describe 'Issues csv', feature: true do
context
'with minimal details'
do
it
'renders labels as nil'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
format: :csv
)
expect
(
csv
[
0
][
'Labels'
]).
to
eq
nil
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