Changeset 7934
- Timestamp:
- 10/16/07 05:07:23 (11 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/assertions/response_assertions.rb
r7776 r7934 80 80 end 81 81 82 @response_diff = url[:expected].diff(url[:actual]) if url[:actual] 83 msg = build_message(message, "response is not a redirection to all of the options supplied (redirection is <?>), difference: <?>", 84 url[:actual], @response_diff) 82 @response_diff = url[:actual].diff(url[:expected]) if url[:actual] 83 msg = build_message(message, "expected a redirect to <?>, found one to <?>, a difference of <?> ", url[:expected], url[:actual], @response_diff) 85 84 86 85 assert_block(msg) do trunk/actionpack/test/controller/redirect_test.rb
r7820 r7934 163 163 assert_redirected_to :action => "other_host", :only_path => true 164 164 rescue Test::Unit::AssertionFailedError => err 165 redirection_msg, diff_msg = err.message.scan(/<\{[^\}]+\}>/).collect { |s| s[2..-3] }165 expected_msg, redirection_msg, diff_msg = err.message.scan(/<\{[^\}]+\}>/).collect { |s| s[2..-3] } 166 166 assert_match %r("only_path"=>false), redirection_msg 167 167 assert_match %r("host"=>"other.test.host"), redirection_msg 168 168 assert_match %r("action"=>"other_host"), redirection_msg 169 assert_match %r("only_path"=> true),diff_msg169 assert_match %r("only_path"=>false), diff_msg 170 170 assert_match %r("host"=>"other.test.host"), diff_msg 171 171 end