Skip to content

Commit d56e8dd

Browse files
committed
Correct failing tests
1 parent 2ac2e95 commit d56e8dd

1 file changed

Lines changed: 13 additions & 16 deletions

File tree

test/plausible_web/controllers/api/external_controller_test.exs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -498,11 +498,11 @@ defmodule PlausibleWeb.Api.ExternalControllerTest do
498498
url: "http://gigride.live/",
499499
domain: "special-props-test.com",
500500
props: %{
501-
campaign_id: 8,
501+
campaign_id: "vendor-8",
502502
company_id: 10,
503503
job_id: 12,
504504
page_id: 15,
505-
product_id: 11,
505+
product_id: "vendor-11",
506506
site_id: 9,
507507
careers_application_form_uuid: "313a26c2-741c-421c-9a6b-f39c02c8d35c"
508508
}
@@ -513,8 +513,8 @@ defmodule PlausibleWeb.Api.ExternalControllerTest do
513513

514514
event = get_event("special-props-test.com")
515515

516-
assert Map.get(event, :campaign_id) == 8
517-
assert Map.get(event, :product_id) == 11
516+
assert Map.get(event, :campaign_id) == "vendor-8"
517+
assert Map.get(event, :product_id) == "vendor-11"
518518
assert Map.get(event, :company_id) == 10
519519
assert Map.get(event, :job_id) == 12
520520
assert Map.get(event, :page_id) == 15
@@ -900,9 +900,7 @@ defmodule PlausibleWeb.Api.ExternalControllerTest do
900900
|> post("/api/event", params)
901901

902902
assert json_response(conn, 400) == %{
903-
"errors" => %{
904-
"hostname" => ["can't be blank"]
905-
}
903+
"errors" => %{"request" => "Unable to process request"}
906904
}
907905
end
908906

@@ -919,9 +917,7 @@ defmodule PlausibleWeb.Api.ExternalControllerTest do
919917
|> post("/api/event", params)
920918

921919
assert json_response(conn, 400) == %{
922-
"errors" => %{
923-
"domain" => ["can't be blank"]
924-
}
920+
"errors" => %{"request" => "Unable to process request"}
925921
}
926922
end
927923
end
@@ -1099,11 +1095,12 @@ defmodule PlausibleWeb.Api.ExternalControllerTest do
10991095
assert pageview.hostname == "liipgellkffekalgefpjolodblggkmjg"
11001096
end
11011097

1102-
describe "GET /api/health" do
1103-
test "returns 200 OK", %{conn: conn} do
1104-
conn = get(conn, "/api/health")
1098+
# /api/health path is disabled in PlausibleWeb.Router module
1099+
# describe "GET /api/health" do
1100+
# test "returns 200 OK", %{conn: conn} do
1101+
# conn = get(conn, "/api/health")
11051102

1106-
assert conn.status == 200
1107-
end
1108-
end
1103+
# assert conn.status == 200
1104+
# end
1105+
# end
11091106
end

0 commit comments

Comments
 (0)