From d10ab869a7433c0e7c6f8ddbc56e23ec2098c97c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 18 Jan 2017 12:51:41 +0000 Subject: Handle csv columns selection in query to preload appropriate associations (#24865). git-svn-id: http://svn.redmine.org/redmine/trunk@16219 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/issues_controller_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/functional/issues_controller_test.rb') diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index e01b69f47..2e9a11c42 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -481,7 +481,7 @@ class IssuesControllerTest < Redmine::ControllerTest Issue.generate!(:description => 'test_index_csv_with_description') with_settings :default_language => 'en' do - get :index, :format => 'csv', :csv => {:description => '1'} + get :index, :format => 'csv', :c => [:tracker, :description] assert_response :success end @@ -503,7 +503,7 @@ class IssuesControllerTest < Redmine::ControllerTest end def test_index_csv_with_all_columns - get :index, :format => 'csv', :csv => {:columns => 'all'} + get :index, :format => 'csv', :c => ['all_inline'] assert_response :success assert_equal 'text/csv; header=present', @response.content_type @@ -518,7 +518,7 @@ class IssuesControllerTest < Redmine::ControllerTest issue.custom_field_values = {1 => ['MySQL', 'Oracle']} issue.save! - get :index, :format => 'csv', :csv => {:columns => 'all'} + get :index, :format => 'csv', :c => ['tracker', "cf_1"] assert_response :success lines = @response.body.chomp.split("\n") assert lines.detect {|line| line.include?('"MySQL, Oracle"')} @@ -529,14 +529,14 @@ class IssuesControllerTest < Redmine::ControllerTest issue = Issue.generate!(:project_id => 1, :tracker_id => 1, :custom_field_values => {field.id => '185.6'}) with_settings :default_language => 'fr' do - get :index, :format => 'csv', :csv => {:columns => 'all'} + get :index, :format => 'csv', :c => ['id', 'tracker', "cf_#{field.id}"] assert_response :success issue_line = response.body.chomp.split("\n").map {|line| line.split(';')}.detect {|line| line[0]==issue.id.to_s} assert_include '185,60', issue_line end with_settings :default_language => 'en' do - get :index, :format => 'csv', :csv => {:columns => 'all'} + get :index, :format => 'csv', :c => ['id', 'tracker', "cf_#{field.id}"] assert_response :success issue_line = response.body.chomp.split("\n").map {|line| line.split(',')}.detect {|line| line[0]==issue.id.to_s} assert_include '185.60', issue_line -- cgit v1.2.3