From aeea7f7e23d806c6439d91949ca9e1c147920548 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 12 Mar 2016 09:54:40 +0000 Subject: Adds query params as hidden field tags to the CSV export form (#22108). git-svn-id: http://svn.redmine.org/redmine/trunk@15202 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/issues_controller_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test') diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 0ad26973e..e325e7f36 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -428,6 +428,26 @@ class IssuesControllerTest < ActionController::TestCase end end + def test_index_should_include_query_params_as_hidden_fields_in_csv_export_form + get :index, :project_id => 1, :set_filter => "1", :tracker_id => "2", :sort => 'status', :c => ["status", "priority"] + + assert_select '#csv-export-form[action=?]', '/projects/ecookbook/issues.csv' + assert_select '#csv-export-form[method=?]', 'get' + + assert_select '#csv-export-form' do + assert_select 'input[name=?][value=?]', 'set_filter', '1' + + assert_select 'input[name=?][value=?]', 'f[]', 'tracker_id' + assert_select 'input[name=?][value=?]', 'op[tracker_id]', '=' + assert_select 'input[name=?][value=?]', 'v[tracker_id][]', '2' + + assert_select 'input[name=?][value=?]', 'c[]', 'status' + assert_select 'input[name=?][value=?]', 'c[]', 'priority' + + assert_select 'input[name=?][value=?]', 'sort', 'status' + end + end + def test_index_csv get :index, :format => 'csv' assert_response :success -- cgit v1.2.3