From 044da18fec2fad44cf8f6c97594972bd0c6e7ead Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Fri, 30 Oct 2020 11:05:19 +0200 Subject: [PATCH] Fix tests for metadata --- .../api/stats_controller/conversions_test.exs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/plausible_web/controllers/api/stats_controller/conversions_test.exs b/test/plausible_web/controllers/api/stats_controller/conversions_test.exs index 51ccb5d94..2d705d13c 100644 --- a/test/plausible_web/controllers/api/stats_controller/conversions_test.exs +++ b/test/plausible_web/controllers/api/stats_controller/conversions_test.exs @@ -12,8 +12,8 @@ defmodule PlausibleWeb.Api.StatsController.ConversionsTest do conn = get(conn, "/api/stats/#{site.domain}/conversions?period=day&date=2019-01-01") assert json_response(conn, 200) == [ - %{"name" => "Signup", "count" => 3, "total_count" => 3, "meta_keys" => ["variant"]}, - %{"name" => "Visit /register", "count" => 2, "total_count" => 2, "meta_keys" => nil} + %{"name" => "Signup", "count" => 3, "total_count" => 3, "prop_names" => ["variant"]}, + %{"name" => "Visit /register", "count" => 2, "total_count" => 2, "prop_names" => nil} ] end end @@ -34,23 +34,23 @@ defmodule PlausibleWeb.Api.StatsController.ConversionsTest do ) assert json_response(conn, 200) == [ - %{"name" => "Signup", "count" => 3, "total_count" => 3, "meta_keys" => ["variant"]} + %{"name" => "Signup", "count" => 3, "total_count" => 3, "prop_names" => ["variant"]} ] end end - describe "GET /api/stats/:domain/meta-breakdown/:key" do + describe "GET /api/stats/:domain/property/:key" do setup [:create_user, :log_in, :create_site] test "returns metadata breakdown for goal", %{conn: conn, site: site} do insert(:goal, %{domain: site.domain, event_name: "Signup"}) filters = Jason.encode!(%{goal: "Signup"}) - meta_key = "variant" + prop_key = "variant" conn = get( conn, - "/api/stats/#{site.domain}/meta-breakdown/#{meta_key}?period=day&date=2019-01-01&filters=#{filters}" + "/api/stats/#{site.domain}/property/#{prop_key}?period=day&date=2019-01-01&filters=#{filters}" ) assert json_response(conn, 200) == [