diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-03-03 04:19:39 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-03-03 04:45:30 -0300 |
commit | cb9d03f0d46b17986894a3aadaad6eaa55dc66b3 (patch) | |
tree | 335ca7a33b6c58f82b441f48d077ce5e45998ece /activemodel/test | |
parent | eafa58b566c770d5d5dc5706464ab4b67e453464 (diff) | |
download | rails-cb9d03f0d46b17986894a3aadaad6eaa55dc66b3.tar.gz rails-cb9d03f0d46b17986894a3aadaad6eaa55dc66b3.tar.bz2 rails-cb9d03f0d46b17986894a3aadaad6eaa55dc66b3.zip |
Add docs with usage examples for ActiveModel::Model
Also add test to ensure basic model does not explode when
initialized with nil.
Diffstat (limited to 'activemodel/test')
-rw-r--r-- | activemodel/test/cases/model_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activemodel/test/cases/model_test.rb b/activemodel/test/cases/model_test.rb index d3e00b044f..d93fd96b88 100644 --- a/activemodel/test/cases/model_test.rb +++ b/activemodel/test/cases/model_test.rb @@ -16,4 +16,11 @@ class ModelTest < ActiveModel::TestCase object = BasicModel.new(:attr => "value") assert_equal object.attr, "value" end + + def test_initialize_with_nil_or_empty_hash_params_does_not_explode + assert_nothing_raised do + BasicModel.new() + BasicModel.new({}) + end + end end |