Changeset 8284
- Timestamp:
- 12/05/07 14:40:42 (1 year ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/assertions/dom_assertions.rb (modified) (2 diffs)
- trunk/actionpack/lib/action_controller/assertions/model_assertions.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/assertions/response_assertions.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r8283 r8284 1 1 *SVN* 2 3 * Add examples in the documentation for various assertions. Closes #9938 [zapnap] 2 4 3 5 * When a NonInferrableControllerError is raised, make the proposed fix clearer in the error message. Closes #10199 [danger] trunk/actionpack/lib/action_controller/assertions/dom_assertions.rb
r7437 r8284 3 3 module DomAssertions 4 4 # Test two HTML strings for equivalency (e.g., identical up to reordering of attributes) 5 # 6 # ==== Examples 7 # 8 # # assert that the referenced method generates the appropriate HTML string 9 # assert_dom_equal '<a href="http://www.example.com">Apples</a>', link_to("Apples", "http://www.example.com") 10 # 5 11 def assert_dom_equal(expected, actual, message = "") 6 12 clean_backtrace do … … 14 20 15 21 # The negated form of +assert_dom_equivalent+. 22 # 23 # ==== Examples 24 # 25 # # assert that the referenced method does not generate the specified HTML string 26 # assert_dom_not_equal '<a href="http://www.example.com">Apples</a>', link_to("Oranges", "http://www.example.com") 27 # 16 28 def assert_dom_not_equal(expected, actual, message = "") 17 29 clean_backtrace do trunk/actionpack/lib/action_controller/assertions/model_assertions.rb
r6470 r8284 3 3 module ModelAssertions 4 4 # Ensures that the passed record is valid by ActiveRecord standards and returns any error messages if it is not. 5 # 6 # ==== Examples 7 # 8 # # assert that a newly created record is valid 9 # model = Model.new 10 # assert_valid(model) 11 # 5 12 def assert_valid(record) 6 13 clean_backtrace do trunk/actionpack/lib/action_controller/assertions/response_assertions.rb
r8106 r8284 15 15 # or its symbolic equivalent assert_response(:not_implemented). 16 16 # See ActionController::StatusCodes for a full list. 17 # 18 # ==== Examples 19 # 20 # # assert that the response was a redirection 21 # assert_response :redirect 22 # 23 # # assert that the response code was status code 401 (unauthorized) 24 # assert_response 401 25 # 17 26 def assert_response(type, message = nil) 18 27 clean_backtrace do … … 29 38 end 30 39 31 # Assert that the redirection options passed in match those of the redirect called in the latest action. This match can be partial, 32 # such that assert_redirected_to(:controller => "weblog") will also match the redirection of 33 # redirect_to(:controller => "weblog", :action => "show") and so on. 40 # Assert that the redirection options passed in match those of the redirect called in the latest action. 41 # This match can be partial, such that assert_redirected_to(:controller => "weblog") will also 42 # match the redirection of redirect_to(:controller => "weblog", :action => "show") and so on. 43 # 44 # ==== Examples 45 # 46 # # assert that the redirection was to the "index" action on the WeblogController 47 # assert_redirected_to :controller => "weblog", :action => "index" 48 # 49 # # assert that the redirection was to the named route login_url 50 # assert_redirected_to login_url 51 # 34 52 def assert_redirected_to(options = {}, message=nil) 35 53 clean_backtrace do … … 105 123 106 124 # Asserts that the request was rendered with the appropriate template file. 125 # 126 # ==== Examples 127 # 128 # # assert that the "new" view template was rendered 129 # assert_template "new" 130 # 107 131 def assert_template(expected = nil, message=nil) 108 132 clean_backtrace do