diff options
Diffstat (limited to 'test/unit/initializers')
-rw-r--r-- | test/unit/initializers/patches_test.rb | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/test/unit/initializers/patches_test.rb b/test/unit/initializers/patches_test.rb index 1fc234d70..f46c905e1 100644 --- a/test/unit/initializers/patches_test.rb +++ b/test/unit/initializers/patches_test.rb @@ -20,21 +20,19 @@ require File.expand_path('../../../test_helper', __FILE__) class PatchesTest < ActiveSupport::TestCase include Redmine::I18n - context "ActiveRecord::Base.human_attribute_name" do - setup do - Setting.default_language = 'en' - end + def setup + Setting.default_language = 'en' + end - should "transform name to field_name" do - assert_equal l('field_last_login_on'), ActiveRecord::Base.human_attribute_name('last_login_on') - end + test "ActiveRecord::Base.human_attribute_name should transform name to field_name" do + assert_equal l('field_last_login_on'), ActiveRecord::Base.human_attribute_name('last_login_on') + end - should "cut extra _id suffix for better validation" do - assert_equal l('field_last_login_on'), ActiveRecord::Base.human_attribute_name('last_login_on_id') - end + test "ActiveRecord::Base.human_attribute_name should cut extra _id suffix for better validation" do + assert_equal l('field_last_login_on'), ActiveRecord::Base.human_attribute_name('last_login_on_id') + end - should "default to humanized value if no translation has been found (useful for custom fields)" do - assert_equal 'Patch name', ActiveRecord::Base.human_attribute_name('Patch name') - end + test "ActiveRecord::Base.human_attribute_name should default to humanized value if no translation has been found (useful for custom fields)" do + assert_equal 'Patch name', ActiveRecord::Base.human_attribute_name('Patch name') end end |