diff options
Diffstat (limited to 'activemodel/test')
-rw-r--r-- | activemodel/test/cases/attribute_methods_test.rb | 31 |
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') |