mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 17:44:43 +03:00
Fix issue with snippet code
This commit is contained in:
parent
1be43a6ce6
commit
08eba461df
@ -27,6 +27,8 @@ defmodule PlausibleWeb.SiteController do
|
||||
|
||||
def add_snippet(conn, %{"website" => website}) do
|
||||
site = Sites.get_for_user!(conn.assigns[:current_user].id, website)
|
||||
|> Repo.preload(:custom_domain)
|
||||
|
||||
conn
|
||||
|> assign(:skip_plausible_tracking, true)
|
||||
|> render("snippet.html", site: site, layout: {PlausibleWeb.LayoutView, "focus.html"})
|
||||
|
@ -63,6 +63,16 @@ defmodule PlausibleWeb.SiteControllerTest do
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET /:website/snippet" do
|
||||
setup [:create_user, :log_in, :create_site]
|
||||
|
||||
test "shows snippet", %{conn: conn, site: site} do
|
||||
conn = get(conn, "/#{site.domain}/snippet")
|
||||
|
||||
assert html_response(conn, 200) =~ "Add javascript snippet"
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET /:website/settings" do
|
||||
setup [:create_user, :log_in, :create_site]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user