Created
November 24, 2017 07:13
-
-
Save lukasender/3714ce850bee0ebef04f11cf77c1f7a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Router example: | |
get "/", Redirector, external: "http://other-domain/" | |
# Test case: | |
test "route redirected to external route without path/query" do | |
conn = call(Router, :get, "/") | |
assert_redirected_to(conn, "http://other-domain/") | |
end | |
# Additional code in "redirector.ex" which handles this case: | |
defp merge_query_string(%URI{query: nil} = destination_uri, %Plug.Conn{query_string: ""}) do | |
destination_uri | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment