Adjust tests

This commit is contained in:
Uku Taht 2021-09-10 12:55:59 +03:00
parent bd797c201f
commit 7e772151e3
2 changed files with 3 additions and 4 deletions

View File

@ -175,10 +175,9 @@ defmodule PlausibleWeb.Api.ExternalController do
result =
PlausibleWeb.RemoteIp.get(conn)
|> Geolix.lookup()
|> Map.get(:country)
if result && result.country do
result.country.iso_code
if result && result[:country] && result[:country].country do
result[:country].country.iso_code
end
end

View File

@ -740,7 +740,7 @@ defmodule PlausibleWeb.Api.ExternalControllerTest do
conn
|> put_req_header("user-agent", @user_agent)
|> put_req_header("x-forwarded-for", "127.0.0.2")
|> put_req_header("x-forwarded-for", "982.32.12.1")
|> post("/api/event", params)
[one, two] = get_events("user-id-test-domain-2.com")