@@ -155,6 +155,10 module QueriesHelper | |||||
155 | when 'IssueRelation' |
|
155 | when 'IssueRelation' | |
156 | other = value.other_issue(issue) |
|
156 | other = value.other_issue(issue) | |
157 | l(value.label_for(issue)) + " ##{other.id}" |
|
157 | l(value.label_for(issue)) + " ##{other.id}" | |
|
158 | when 'TrueClass' | |||
|
159 | l(:general_text_Yes) | |||
|
160 | when 'FalseClass' | |||
|
161 | l(:general_text_No) | |||
158 | else |
|
162 | else | |
159 | value.to_s |
|
163 | value.to_s | |
160 | end |
|
164 | end |
@@ -111,6 +111,14 class ActiveSupport::TestCase | |||||
111 | User.current = saved_user |
|
111 | User.current = saved_user | |
112 | end |
|
112 | end | |
113 |
|
113 | |||
|
114 | def with_locale(locale, &block) | |||
|
115 | saved_localed = ::I18n.locale | |||
|
116 | ::I18n.locale = locale | |||
|
117 | yield | |||
|
118 | ensure | |||
|
119 | ::I18n.locale = saved_localed | |||
|
120 | end | |||
|
121 | ||||
114 | def change_user_password(login, new_password) |
|
122 | def change_user_password(login, new_password) | |
115 | user = User.where(:login => login).first |
|
123 | user = User.where(:login => login).first | |
116 | user.password, user.password_confirmation = new_password, new_password |
|
124 | user.password, user.password_confirmation = new_password, new_password |
@@ -36,4 +36,18 class QueriesHelperTest < ActionView::TestCase | |||||
36 | assert_equal filter_count + 1, fo.size |
|
36 | assert_equal filter_count + 1, fo.size | |
37 | assert_equal [], fo[0] |
|
37 | assert_equal [], fo[0] | |
38 | end |
|
38 | end | |
|
39 | ||||
|
40 | def test_query_to_csv_should_translate_boolean_custom_field_values | |||
|
41 | f = IssueCustomField.generate!(:field_format => 'bool', :name => 'Boolean', :is_for_all => true, :trackers => Tracker.all) | |||
|
42 | issues = [ | |||
|
43 | Issue.generate!(:project_id => 1, :tracker_id => 1, :custom_field_values => {f.id.to_s => '0'}), | |||
|
44 | Issue.generate!(:project_id => 1, :tracker_id => 1, :custom_field_values => {f.id.to_s => '1'}) | |||
|
45 | ] | |||
|
46 | ||||
|
47 | with_locale 'fr' do | |||
|
48 | csv = query_to_csv(issues, IssueQuery.new, :columns => 'all') | |||
|
49 | assert_include "Oui", csv | |||
|
50 | assert_include "Non", csv | |||
|
51 | end | |||
|
52 | end | |||
39 | end |
|
53 | end |
General Comments 0
You need to be logged in to leave comments.
Login now