annotate test/unit/initializers/patches_test.rb @ 1458:b1f4c9a2af24 bug_794

Makes the default radio button checked by default -- this should fix bug #794.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Mon, 11 Nov 2013 18:25:22 +0000
parents 433d4f72a19b
children 622f24f53b42 261b3d9a4903
rev   line source
Chris@507 1 # Redmine - project management software
Chris@1115 2 # Copyright (C) 2006-2012 Jean-Philippe Lang
Chris@507 3 #
Chris@507 4 # This program is free software; you can redistribute it and/or
Chris@507 5 # modify it under the terms of the GNU General Public License
Chris@507 6 # as published by the Free Software Foundation; either version 2
Chris@507 7 # of the License, or (at your option) any later version.
Chris@507 8 #
Chris@507 9 # This program is distributed in the hope that it will be useful,
Chris@507 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@507 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@507 12 # GNU General Public License for more details.
Chris@507 13 #
Chris@507 14 # You should have received a copy of the GNU General Public License
Chris@507 15 # along with this program; if not, write to the Free Software
Chris@507 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Chris@507 17
Chris@507 18 require File.expand_path('../../../test_helper', __FILE__)
Chris@507 19
Chris@507 20 class PatchesTest < ActiveSupport::TestCase
Chris@507 21 include Redmine::I18n
Chris@507 22
Chris@507 23 context "ActiveRecord::Base.human_attribute_name" do
Chris@507 24 setup do
Chris@507 25 Setting.default_language = 'en'
Chris@507 26 end
Chris@507 27
Chris@507 28 should "transform name to field_name" do
Chris@507 29 assert_equal l('field_last_login_on'), ActiveRecord::Base.human_attribute_name('last_login_on')
Chris@507 30 end
Chris@507 31
Chris@507 32 should "cut extra _id suffix for better validation" do
Chris@507 33 assert_equal l('field_last_login_on'), ActiveRecord::Base.human_attribute_name('last_login_on_id')
Chris@507 34 end
Chris@507 35
Chris@507 36 should "default to humanized value if no translation has been found (useful for custom fields)" do
Chris@507 37 assert_equal 'Patch name', ActiveRecord::Base.human_attribute_name('Patch name')
Chris@507 38 end
Chris@507 39 end
Chris@507 40 end