diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2013-06-18 22:31:10 -0700 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2013-06-18 22:31:10 -0700 |
commit | 878ab18c5e6b0d9dd3c0608fc54265de4ad6665d (patch) | |
tree | d1699978e83a6d7034851b2c39c98dd820f688e9 /activemodel/test/cases | |
parent | 2b817a5e89ac0e7aeb894a40ae7151a0cf3cef16 (diff) | |
parent | e3dc10f13393c0b1329f31062a50b5c050159151 (diff) | |
download | rails-878ab18c5e6b0d9dd3c0608fc54265de4ad6665d.tar.gz rails-878ab18c5e6b0d9dd3c0608fc54265de4ad6665d.tar.bz2 rails-878ab18c5e6b0d9dd3c0608fc54265de4ad6665d.zip |
Merge pull request #11002 from fredwu/master-activemodel-inclusion-chain-fix
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 |