Project

General

Profile

Defect #23206 » fix_csv_export_when_issues_filter_is_blank_v2.diff

patch v2 - Go MAEDA, 2016-06-30 16:37

View differences:

app/helpers/queries_helper.rb (working copy)
tags << hidden_field_tag("v[#{field}][]", value, :id => nil)
end
end
else
tags << hidden_field_tag("f[]", "", :id => nil)
end
if query.column_names.present?
query.column_names.each do |name|
test/functional/issues_controller_test.rb (working copy)
assert_select 'input[name=?][value=?]', 'sort', 'status'
end
get :index, :project_id => 1, :set_filter => "1", :f => []
assert_select '#csv-export-form input[name=?][value=?]', 'f[]', ''
end
def test_index_csv
......
assert_equal 'text/csv; header=present', @response.content_type
end
def test_index_csv_without_any_filters
@request.session[:user_id] = 1
Issue.create!(:project_id => 1, :tracker_id => 1, :status_id => 5, :subject => 'Closed issue', :author_id => 1)
get :index, :set_filter => 1, :f => [], :format => 'csv'
assert_response :success
assert_equal Issue.count, assigns(:issues).count
end
def test_index_csv_with_description
Issue.generate!(:description => 'test_index_csv_with_description')
(2-2/2)