Skip to content
Browse files

Adding tests for ActiveModel::Model

* Verifying persisted? is false when Model initialized
* Passing nil to Model should not blow up
* Changing test name to the one suggested in pull request comment
  • Loading branch information...
1 parent 6581d79 commit 01434a5ee651972e3ec13cd5a55e32409b17a9e1 @adomokos adomokos committed Jan 12, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 activemodel/test/cases/model_test.rb
View
6 activemodel/test/cases/model_test.rb
@@ -20,7 +20,13 @@ def test_initialize_with_params
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

0 comments on commit 01434a5

Please sign in to comment.
Something went wrong with that request. Please try again.