aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/model_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/test/cases/model_test.rb')
-rw-r--r--activemodel/test/cases/model_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activemodel/test/cases/model_test.rb b/activemodel/test/cases/model_test.rb
index d93fd96b88..588d8e661e 100644
--- a/activemodel/test/cases/model_test.rb
+++ b/activemodel/test/cases/model_test.rb
@@ -20,7 +20,13 @@ class ModelTest < ActiveModel::TestCase
def test_initialize_with_nil_or_empty_hash_params_does_not_explode
assert_nothing_raised do
BasicModel.new()
+ BasicModel.new nil
BasicModel.new({})
end
end
+
+ def test_persisted_is_always_false
+ object = BasicModel.new(:attr => "value")
+ assert object.persisted? == false
+ end
end