Issue index CSV uses currently applied filters
This commit is contained in:
parent
17600f5f6a
commit
c777bb91fd
|
|
@ -19,6 +19,7 @@
|
|||
#
|
||||
class IssuableFinder
|
||||
NONE = '0'
|
||||
VALID_PARAMS = %i(scope state group_id project_id milestone_title assignee_id search label_name sort)
|
||||
|
||||
attr_accessor :current_user, :params
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
- if current_user
|
||||
= link_to url_for(params.merge(format: :atom, private_token: current_user.private_token)), class: 'btn append-right-10 has-tooltip', title: 'Subscribe' do
|
||||
= icon('rss')
|
||||
= link_to namespace_project_issues_path(@project.namespace, @project, :csv), class: 'btn append-right-10 has-tooltip', title: 'Download CSV' do
|
||||
= link_to namespace_project_issues_path(@project.namespace, @project, params.permit(IssuableFinder::VALID_PARAMS).merge(format: :csv)), class: 'btn append-right-10 has-tooltip', title: 'Download CSV' do
|
||||
= icon('download')
|
||||
- if can? current_user, :create_issue, @project
|
||||
= link_to new_namespace_project_issue_path(@project.namespace,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,13 @@ describe 'Issues csv', feature: true do
|
|||
expect(csv.count).to eq 31
|
||||
end
|
||||
|
||||
it 'uses filters from issue index' do
|
||||
visit namespace_project_issues_path(project.namespace, project, state: :closed)
|
||||
click_on 'Download CSV'
|
||||
|
||||
expect(csv.count).to eq 0
|
||||
end
|
||||
|
||||
context 'includes' do
|
||||
let(:label1) { create(:label, project: project, title: 'Feature') }
|
||||
let(:label2) { create(:label, project: project, title: 'labels') }
|
||||
|
|
|
|||
Loading…
Reference in New Issue