diff options
author | Marcel Molina <marcel@vernix.org> | 2007-12-05 14:40:42 +0000 |
---|---|---|
committer | Marcel Molina <marcel@vernix.org> | 2007-12-05 14:40:42 +0000 |
commit | 096f3f64680c9f19c78999a6b2ffdaca9606403c (patch) | |
tree | a39ab496a03de12da15d0cc8c24c314b2bf694b3 /actionpack/lib/action_controller/assertions/model_assertions.rb | |
parent | da5fef45fe259dc47d00c3c52cfa336ade412645 (diff) | |
download | rails-096f3f64680c9f19c78999a6b2ffdaca9606403c.tar.gz rails-096f3f64680c9f19c78999a6b2ffdaca9606403c.tar.bz2 rails-096f3f64680c9f19c78999a6b2ffdaca9606403c.zip |
Add examples in the documentation for various assertions. Closes #9938 [zapnap]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8284 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/assertions/model_assertions.rb')
-rw-r--r-- | actionpack/lib/action_controller/assertions/model_assertions.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/assertions/model_assertions.rb b/actionpack/lib/action_controller/assertions/model_assertions.rb index 5fc5c81cb7..0b4313055a 100644 --- a/actionpack/lib/action_controller/assertions/model_assertions.rb +++ b/actionpack/lib/action_controller/assertions/model_assertions.rb @@ -2,6 +2,13 @@ module ActionController module Assertions module ModelAssertions # Ensures that the passed record is valid by ActiveRecord standards and returns any error messages if it is not. + # + # ==== Examples + # + # # assert that a newly created record is valid + # model = Model.new + # assert_valid(model) + # def assert_valid(record) clean_backtrace do assert record.valid?, record.errors.full_messages.join("\n") @@ -9,4 +16,4 @@ module ActionController end end end -end
\ No newline at end of file +end |