mirror of
https://github.com/plausible/analytics.git
synced 2024-12-27 03:21:37 +03:00
7dbbc8ba22
* Use site id instead of hostname for events * Use site id in domain status check * Revert change to tracking module * Catch more places where link generation needed updating * Rename site_id to domain * Drop hostname index from events
24 lines
661 B
Elixir
24 lines
661 B
Elixir
defmodule PlausibleWeb.Api.InternalControllerTest do
|
|
use PlausibleWeb.ConnCase
|
|
use Plausible.Repo
|
|
import Plausible.TestUtils
|
|
|
|
describe "GET /:domain/status" do
|
|
setup [:create_user, :log_in, :create_site]
|
|
|
|
test "is WAITING when site has no pageviews", %{conn: conn, site: site} do
|
|
conn = get(conn, "/api/#{site.domain}/status")
|
|
|
|
assert json_response(conn, 200) == "WAITING"
|
|
end
|
|
|
|
test "is READY when site has at least 1 pageview", %{conn: conn, site: site} do
|
|
insert(:pageview, domain: site.domain)
|
|
|
|
conn = get(conn, "/api/#{site.domain}/status")
|
|
|
|
assert json_response(conn, 200) == "READY"
|
|
end
|
|
end
|
|
end
|