##// END OF EJS Templates
Fixed: Undefined Method (l_YesNo) Being Called (#2867)....
Jean-Philippe Lang -
r2473:b78349d2caab
parent child
Show More
@@ -0,0 +1,29
1 # Redmine - project management software
2 # Copyright (C) 2006-2009 Jean-Philippe Lang
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 require File.dirname(__FILE__) + '/../../test_helper'
19
20 class CustomFieldsHelperTest < HelperTestCase
21 include CustomFieldsHelper
22 include Redmine::I18n
23
24 def test_format_boolean_value
25 I18n.locale = 'en'
26 assert_equal 'Yes', format_value('1', 'bool')
27 assert_equal 'No', format_value('0', 'bool')
28 end
29 end
@@ -75,7 +75,7 module CustomFieldsHelper
75 when "date"
75 when "date"
76 begin; format_date(value.to_date); rescue; value end
76 begin; format_date(value.to_date); rescue; value end
77 when "bool"
77 when "bool"
78 l_YesNo(value == "1")
78 l(value == "1" ? :general_text_Yes : :general_text_No)
79 else
79 else
80 value
80 value
81 end
81 end
General Comments 0
You need to be logged in to leave comments. Login now