User.current = saved_user
end
+ def with_locale(locale, &block)
+ saved_localed = ::I18n.locale
+ ::I18n.locale = locale
+ yield
+ ensure
+ ::I18n.locale = saved_localed
+ end
+
def change_user_password(login, new_password)
user = User.where(:login => login).first
user.password, user.password_confirmation = new_password, new_password
assert_equal filter_count + 1, fo.size
assert_equal [], fo[0]
end
+
+ def test_query_to_csv_should_translate_boolean_custom_field_values
+ f = IssueCustomField.generate!(:field_format => 'bool', :name => 'Boolean', :is_for_all => true, :trackers => Tracker.all)
+ issues = [
+ Issue.generate!(:project_id => 1, :tracker_id => 1, :custom_field_values => {f.id.to_s => '0'}),
+ Issue.generate!(:project_id => 1, :tracker_id => 1, :custom_field_values => {f.id.to_s => '1'})
+ ]
+
+ with_locale 'fr' do
+ csv = query_to_csv(issues, IssueQuery.new, :columns => 'all')
+ assert_include "Oui", csv
+ assert_include "Non", csv
+ end
+ end
end