Removed some shoulda context.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11865 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2013-05-18 09:27:48 +00:00
parent 474c010746
commit 61dfab12fd
5 changed files with 143 additions and 172 deletions
+11 -13
View File
@@ -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