##// END OF EJS Templates
remove trailing white-spaces and code clean up init i18n test....
Toshi MARUYAMA -
r5587:e68206852e43
parent child
Show More
@@ -1,5 +1,5
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2009 Jean-Philippe Lang
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
@@ -47,8 +47,10 class Redmine::I18nTest < ActiveSupport::TestCase
47 format_date(Date.today)
47 format_date(Date.today)
48 format_time(Time.now)
48 format_time(Time.now)
49 format_time(Time.now, false)
49 format_time(Time.now, false)
50 assert_not_equal 'default', ::I18n.l(Date.today, :format => :default), "date.formats.default missing in #{lang}"
50 assert_not_equal 'default', ::I18n.l(Date.today, :format => :default),
51 assert_not_equal 'time', ::I18n.l(Time.now, :format => :time), "time.formats.time missing in #{lang}"
51 "date.formats.default missing in #{lang}"
52 assert_not_equal 'time', ::I18n.l(Time.now, :format => :time),
53 "time.formats.time missing in #{lang}"
52 end
54 end
53 assert l('date.day_names').is_a?(Array)
55 assert l('date.day_names').is_a?(Array)
54 assert_equal 7, l('date.day_names').size
56 assert_equal 7, l('date.day_names').size
@@ -66,7 +68,6 class Redmine::I18nTest < ActiveSupport::TestCase
66 assert_equal '02/20/2011 15:45', format_time(now)
68 assert_equal '02/20/2011 15:45', format_time(now)
67 assert_equal '15:45', format_time(now, false)
69 assert_equal '15:45', format_time(now, false)
68 end
70 end
69
70 with_settings :date_format => '%Y-%m-%d' do
71 with_settings :date_format => '%Y-%m-%d' do
71 assert_equal '2011-02-20 15:45', format_time(now)
72 assert_equal '2011-02-20 15:45', format_time(now)
72 assert_equal '15:45', format_time(now, false)
73 assert_equal '15:45', format_time(now, false)
@@ -82,7 +83,6 class Redmine::I18nTest < ActiveSupport::TestCase
82 assert_equal '02/20/2011 03:45 pm', format_time(now)
83 assert_equal '02/20/2011 03:45 pm', format_time(now)
83 assert_equal '03:45 pm', format_time(now, false)
84 assert_equal '03:45 pm', format_time(now, false)
84 end
85 end
85
86 with_settings :date_format => '%Y-%m-%d' do
86 with_settings :date_format => '%Y-%m-%d' do
87 assert_equal '2011-02-20 03:45 pm', format_time(now)
87 assert_equal '2011-02-20 03:45 pm', format_time(now)
88 assert_equal '03:45 pm', format_time(now, false)
88 assert_equal '03:45 pm', format_time(now, false)
@@ -129,7 +129,6 class Redmine::I18nTest < ActiveSupport::TestCase
129 'zh-tw' => :"zh-TW",
129 'zh-tw' => :"zh-TW",
130 'zh-TW' => :"zh-TW",
130 'zh-TW' => :"zh-TW",
131 'zh-ZZ' => nil }
131 'zh-ZZ' => nil }
132
133 to_test.each {|lang, expected| assert_equal expected, find_language(lang)}
132 to_test.each {|lang, expected| assert_equal expected, find_language(lang)}
134 end
133 end
135
134
General Comments 0
You need to be logged in to leave comments. Login now