mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #25236 from rajatbansal93/fix-typo
fix typo [ci skip]
This commit is contained in:
commit
7b75ca100d
1 changed files with 5 additions and 5 deletions
|
@ -166,7 +166,7 @@ module TestGenerationPrefix
|
||||||
assert_equal "/pure-awesomeness/blog/posts/1", last_response.body
|
assert_equal "/pure-awesomeness/blog/posts/1", last_response.body
|
||||||
end
|
end
|
||||||
|
|
||||||
test "[ENGINE] url_helpers from engine have higher priotity than application's url_helpers" do
|
test "[ENGINE] url_helpers from engine have higher priority than application's url_helpers" do
|
||||||
get "/awesome/blog/conflicting_url"
|
get "/awesome/blog/conflicting_url"
|
||||||
assert_equal "engine", last_response.body
|
assert_equal "engine", last_response.body
|
||||||
end
|
end
|
||||||
|
@ -319,14 +319,14 @@ module TestGenerationPrefix
|
||||||
path = engine_object.polymorphic_url(Post.new, :host => "www.example.com")
|
path = engine_object.polymorphic_url(Post.new, :host => "www.example.com")
|
||||||
assert_equal "http://www.example.com/awesome/blog/posts/1", path
|
assert_equal "http://www.example.com/awesome/blog/posts/1", path
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def verify_redirect(url, status = 301)
|
def verify_redirect(url, status = 301)
|
||||||
assert_equal status, last_response.status
|
assert_equal status, last_response.status
|
||||||
assert_equal url, last_response.headers["Location"]
|
assert_equal url, last_response.headers["Location"]
|
||||||
assert_equal expected_redirect_body(url), last_response.body
|
assert_equal expected_redirect_body(url), last_response.body
|
||||||
end
|
end
|
||||||
|
|
||||||
def expected_redirect_body(url)
|
def expected_redirect_body(url)
|
||||||
%(<html><body>You are being <a href="#{url}">redirected</a>.</body></html>)
|
%(<html><body>You are being <a href="#{url}">redirected</a>.</body></html>)
|
||||||
end
|
end
|
||||||
|
@ -450,14 +450,14 @@ module TestGenerationPrefix
|
||||||
get "/absolute_custom_redirect"
|
get "/absolute_custom_redirect"
|
||||||
verify_redirect "http://example.org/foo"
|
verify_redirect "http://example.org/foo"
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def verify_redirect(url, status = 301)
|
def verify_redirect(url, status = 301)
|
||||||
assert_equal status, last_response.status
|
assert_equal status, last_response.status
|
||||||
assert_equal url, last_response.headers["Location"]
|
assert_equal url, last_response.headers["Location"]
|
||||||
assert_equal expected_redirect_body(url), last_response.body
|
assert_equal expected_redirect_body(url), last_response.body
|
||||||
end
|
end
|
||||||
|
|
||||||
def expected_redirect_body(url)
|
def expected_redirect_body(url)
|
||||||
%(<html><body>You are being <a href="#{url}">redirected</a>.</body></html>)
|
%(<html><body>You are being <a href="#{url}">redirected</a>.</body></html>)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue