Changeset 7578
- Timestamp:
- 09/22/07 22:22:20 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/assertions/response_assertions.rb
r7437 r7578 79 79 end 80 80 81 @response_diff = url[:expected].diff(url[:actual]) if url[:actual] 82 msg = build_message(message, "response is not a redirection to all of the options supplied (redirection is <?>), difference: <?>", 83 url[:actual], @response_diff) 81 @response_diff = url[:actual].diff(url[:expected]) if url[:actual] 82 msg = build_message(message, "expected a redirect to <?>, found one to <?>, a difference of <?> ", url[:expected], url[:actual], @response_diff) 84 83 85 84 assert_block(msg) do trunk/actionpack/test/template/url_helper_test.rb
r7542 r7578 108 108 def test_link_tag_with_query_and_no_name 109 109 assert_dom_equal "<a href=\"http://www.example.com?q1=v1&q2=v2\">http://www.example.com?q1=v1&q2=v2</a>", link_to(nil, "http://www.example.com?q1=v1&q2=v2") 110 end 111 112 def test_link_tag_with_back 113 @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {'HTTP_REFERER' => 'http://www.example.com/referer'}) 114 assert_dom_equal "<a href=\"http://www.example.com/referer\">go back</a>", link_to('go back', :back) 115 end 116 117 def test_link_tag_with_back_and_no_referer 118 @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {}) 119 assert_dom_equal "<a href=\"javascript:history.back()\">go back</a>", link_to('go back', :back) 110 120 end 111 121