diff options
author | Fred Wu <ifredwu@gmail.com> | 2013-06-19 11:21:35 +1000 |
---|---|---|
committer | Fred Wu <ifredwu@gmail.com> | 2013-06-19 11:25:10 +1000 |
commit | e3dc10f13393c0b1329f31062a50b5c050159151 (patch) | |
tree | d1699978e83a6d7034851b2c39c98dd820f688e9 /activemodel/test/cases | |
parent | 2b817a5e89ac0e7aeb894a40ae7151a0cf3cef16 (diff) | |
download | rails-e3dc10f13393c0b1329f31062a50b5c050159151.tar.gz rails-e3dc10f13393c0b1329f31062a50b5c050159151.tar.bz2 rails-e3dc10f13393c0b1329f31062a50b5c050159151.zip |
Fixed ActiveModel::Model's inclusion chain
Diffstat (limited to 'activemodel/test/cases')
-rw-r--r-- | activemodel/test/cases/model_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activemodel/test/cases/model_test.rb b/activemodel/test/cases/model_test.rb index 24e4ca91c6..375f5907db 100644 --- a/activemodel/test/cases/model_test.rb +++ b/activemodel/test/cases/model_test.rb @@ -3,7 +3,14 @@ require 'cases/helper' class ModelTest < ActiveModel::TestCase include ActiveModel::Lint::Tests + module DefaultValue + def initialize(*args) + @attr ||= 'default value' + end + end + class BasicModel + include DefaultValue include ActiveModel::Model attr_accessor :attr end @@ -29,4 +36,9 @@ class ModelTest < ActiveModel::TestCase object = BasicModel.new(attr: "value") assert object.persisted? == false end + + def test_mixin_inclusion_chain + object = BasicModel.new + assert_equal object.attr, 'default value' + end end |