From 096f3f64680c9f19c78999a6b2ffdaca9606403c Mon Sep 17 00:00:00 2001 From: Marcel Molina Date: Wed, 5 Dec 2007 14:40:42 +0000 Subject: 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 --- actionpack/lib/action_controller/assertions/model_assertions.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller/assertions/model_assertions.rb') 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 -- cgit v1.2.3