|
|
@ -7,8 +7,18 @@ defmodule BlockScoutWeb.ApiDocsViewTest do |
|
|
|
test "returns url with scheme and host without port" do |
|
|
|
test "returns url with scheme and host without port" do |
|
|
|
System.put_env("BLOCKSCOUT_HOST", "localhost") |
|
|
|
System.put_env("BLOCKSCOUT_HOST", "localhost") |
|
|
|
|
|
|
|
|
|
|
|
assert APIDocsView.blockscout_url() == "http://localhost" |
|
|
|
assert APIDocsView.blockscout_url() == "http://localhost/" |
|
|
|
assert Endpoint.url() == "http://localhost:4002" |
|
|
|
assert Endpoint.url() == "http://localhost:4002" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test "returns url with scheme and host with path" do |
|
|
|
|
|
|
|
System.put_env("BLOCKSCOUT_HOST", "localhost/chain/dog") |
|
|
|
|
|
|
|
System.put_env("NETWORK_PATH", "/chain/dog") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert APIDocsView.blockscout_url() == "http://localhost/chain/dog" |
|
|
|
|
|
|
|
assert Endpoint.url() == "http://localhost:4002" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.put_env("NETWORK_PATH", "") |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|