aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-02-27 21:23:59 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2011-02-27 21:30:03 -0200
commita00bed0c48f469d1cd2de364bfaddbc724046195 (patch)
treeb36c81d3939fc5976b23511460df8991a9b3246f /activemodel/test
parentacf0688fdd85a6d6ac278446e81f365239acc198 (diff)
downloadrails-a00bed0c48f469d1cd2de364bfaddbc724046195.tar.gz
rails-a00bed0c48f469d1cd2de364bfaddbc724046195.tar.bz2
rails-a00bed0c48f469d1cd2de364bfaddbc724046195.zip
Revert "Properly interpolate i18n keys in modules [#5572 state:resolved]"
This breaks #6448, you should use :"module/class" as key for namespacing [#6448 state:committed] This reverts commit 8d30193b08bd2321a7a78a1f481bd5e4d4d45557.
Diffstat (limited to 'activemodel/test')
-rw-r--r--activemodel/test/cases/validations/i18n_validation_test.rb19
-rw-r--r--activemodel/test/models/person.rb5
2 files changed, 0 insertions, 24 deletions
diff --git a/activemodel/test/cases/validations/i18n_validation_test.rb b/activemodel/test/cases/validations/i18n_validation_test.rb
index 5cb7bff4e7..e9f0e430fe 100644
--- a/activemodel/test/cases/validations/i18n_validation_test.rb
+++ b/activemodel/test/cases/validations/i18n_validation_test.rb
@@ -55,14 +55,6 @@ class I18nValidationTest < ActiveModel::TestCase
assert_equal ["Person's name not found"], @person.errors.full_messages
end
- def test_errors_full_messages_translates_human_attribute_name_for_model_in_module_attributes
- I18n.backend.store_translations('en', :activemodel => {:attributes => {:person_module => {:person => {:name => "Person in Module's name"}}}})
- person = PersonModule::Person.new
- person.errors.add(:name, 'not found')
- PersonModule::Person.expects(:human_attribute_name).with(:name, :default => 'Name').returns("Person in Module's name")
- assert_equal ["Person in Module's name not found"], person.errors.full_messages
- end
-
def test_errors_full_messages_uses_format
I18n.backend.store_translations('en', :errors => {:format => "Field %{attribute} %{message}"})
@person.errors.add('name', 'empty')
@@ -371,15 +363,4 @@ class I18nValidationTest < ActiveModel::TestCase
assert_equal ["I am a custom error"], @person.errors[:title]
end
- def test_model_with_module_i18n_scope
- I18n.backend.store_translations 'en', :activemodel => {:errors => {:models => {:person_module => {:person => {:blank => 'generic blank'}}}}}
- PersonModule::Person.validates_presence_of :title
- person = PersonModule::Person.new
- person.valid?
- assert_equal ['generic blank'], person.errors[:title]
-
- I18n.backend.store_translations 'en', :activemodel => {:errors => {:models => {:person_module => {:person => {:attributes => {:title => {:blank => 'title cannot be blank'}}}}}}}
- person.valid?
- assert_equal ['title cannot be blank'], person.errors[:title]
- end
end
diff --git a/activemodel/test/models/person.rb b/activemodel/test/models/person.rb
index 7b7e8feebc..e896e90f98 100644
--- a/activemodel/test/models/person.rb
+++ b/activemodel/test/models/person.rb
@@ -15,8 +15,3 @@ end
class Child < Person
end
-
-module PersonModule
- class Person < ::Person
- end
-end