aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/attribute_methods_test.rb
diff options
context:
space:
mode:
authorSergey Nartimov <just.lest@gmail.com>2011-12-24 21:26:15 +0300
committerSergey Nartimov <just.lest@gmail.com>2011-12-24 21:26:15 +0300
commit9813c62330afa59e9f6f52eb5d07cf713b5b8968 (patch)
tree8ed56bad2da1cde3925ee8ce47b130052225a516 /activemodel/test/cases/attribute_methods_test.rb
parentcf0fd053cd197250abaf693adcdbf9d12f24e350 (diff)
downloadrails-9813c62330afa59e9f6f52eb5d07cf713b5b8968.tar.gz
rails-9813c62330afa59e9f6f52eb5d07cf713b5b8968.tar.bz2
rails-9813c62330afa59e9f6f52eb5d07cf713b5b8968.zip
remove deprecated define_attr_method from ActiveModel::AttributeMethods
Diffstat (limited to 'activemodel/test/cases/attribute_methods_test.rb')
-rw-r--r--activemodel/test/cases/attribute_methods_test.rb31
1 files changed, 0 insertions, 31 deletions
diff --git a/activemodel/test/cases/attribute_methods_test.rb b/activemodel/test/cases/attribute_methods_test.rb
index 90f9b78334..0c6e49bee2 100644
--- a/activemodel/test/cases/attribute_methods_test.rb
+++ b/activemodel/test/cases/attribute_methods_test.rb
@@ -133,37 +133,6 @@ class AttributeMethodsTest < ActiveModel::TestCase
assert_equal "value of foo bar", ModelWithAttributesWithSpaces.new.send(:'foo bar')
end
- test '#define_attr_method generates attribute method' do
- assert_deprecated do
- ModelWithAttributes.define_attr_method(:bar, 'bar')
- end
-
- assert_respond_to ModelWithAttributes, :bar
-
- assert_deprecated do
- assert_equal "original bar", ModelWithAttributes.original_bar
- end
-
- assert_equal "bar", ModelWithAttributes.bar
- ActiveSupport::Deprecation.silence do
- ModelWithAttributes.define_attr_method(:bar)
- end
- assert !ModelWithAttributes.bar
- end
-
- test '#define_attr_method generates attribute method with invalid identifier characters' do
- ActiveSupport::Deprecation.silence do
- ModelWithWeirdNamesAttributes.define_attr_method(:'c?d', 'c?d')
- end
-
- assert_respond_to ModelWithWeirdNamesAttributes, :'c?d'
-
- ActiveSupport::Deprecation.silence do
- assert_equal "original c?d", ModelWithWeirdNamesAttributes.send('original_c?d')
- end
- assert_equal "c?d", ModelWithWeirdNamesAttributes.send('c?d')
- end
-
test '#alias_attribute works with attributes with spaces in their names' do
ModelWithAttributesWithSpaces.define_attribute_methods([:'foo bar'])
ModelWithAttributesWithSpaces.alias_attribute(:'foo_bar', :'foo bar')