From 46b271c6e4c7104d2714c6d91a65090260339840 Mon Sep 17 00:00:00 2001 From: Jens Kraemer Date: Tue, 1 May 2018 10:58:05 +0800 Subject: [PATCH] failing test case - csv export with project filter - the test case shows what happens when a saved query with a filter on project_id = some_subproject is executed in the context of subproject's parent project. PDF and web UI show only issues from some_subproject, but the CSV export ignores the project_id filter because of the query serialization that takes place in the modal options form. --- test/functional/issues_controller_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index fc5b035..e42d0ed 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -784,6 +784,23 @@ class IssuesControllerTest < Redmine::ControllerTest end end + def test_index_csv_subprojects + get :index, :params => { + :project_id => 1, + :c => ['id'], + :format => 'csv', + :f => ['project_id'], + :op => {'project_id' => '='}, + :v => {'project_id' => [3]}, + :set_filter => 1 + } + lines = @response.body.chomp.split("\n") + lines.shift # headers + assert_include "5", lines + assert_include "13", lines + assert_equal 2, lines.count + end + def test_index_pdf ["en", "zh", "zh-TW", "ja", "ko"].each do |lang| with_settings :default_language => lang do -- 2.1.4