From 88a713c719c77792da7209f0387d1d73efa96271 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 27 Nov 2011 02:26:36 +0000 Subject: [PATCH] cover the issues pdf test in English and CJK locales git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7940 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/issues_controller_test.rb | 44 ++++++++++++++++------- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index ff89e5a85..42ef84776 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -43,6 +43,8 @@ class IssuesControllerTest < ActionController::TestCase :journal_details, :queries + include Redmine::I18n + def setup @controller = IssuesController.new @request = ActionController::TestRequest.new @@ -379,20 +381,38 @@ class IssuesControllerTest < ActionController::TestCase end def test_index_pdf - get :index, :format => 'pdf' - assert_response :success - assert_not_nil assigns(:issues) - assert_equal 'application/pdf', @response.content_type + ["en", "zh", "zh-TW", "ja", "ko"].each do |lang| + with_settings :default_language => lang do - get :index, :project_id => 1, :format => 'pdf' - assert_response :success - assert_not_nil assigns(:issues) - assert_equal 'application/pdf', @response.content_type + get :index + assert_response :success + assert_template 'index' - get :index, :project_id => 1, :query_id => 6, :format => 'pdf' - assert_response :success - assert_not_nil assigns(:issues) - assert_equal 'application/pdf', @response.content_type + if lang == "ja" + if RUBY_PLATFORM != 'java' + assert_equal "CP932", l(:general_pdf_encoding) + end + if RUBY_PLATFORM == 'java' && l(:general_pdf_encoding) == "CP932" + next + end + end + + get :index, :format => 'pdf' + assert_response :success + assert_not_nil assigns(:issues) + assert_equal 'application/pdf', @response.content_type + + get :index, :project_id => 1, :format => 'pdf' + assert_response :success + assert_not_nil assigns(:issues) + assert_equal 'application/pdf', @response.content_type + + get :index, :project_id => 1, :query_id => 6, :format => 'pdf' + assert_response :success + assert_not_nil assigns(:issues) + assert_equal 'application/pdf', @response.content_type + end + end end def test_index_pdf_with_query_grouped_by_list_custom_field