From f9cae3ff3ce4362c24b63a424183b06a443ad0d4 Mon Sep 17 00:00:00 2001 From: Kayla Firestack Date: Tue, 28 Jan 2025 17:40:08 -0500 Subject: [PATCH] fix:test: generate snapshot for test so all properties are present --- .../controllers/detours_controller_test.exs | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/test/skate_web/controllers/detours_controller_test.exs b/test/skate_web/controllers/detours_controller_test.exs index bf8a8ac14..f3e057baa 100644 --- a/test/skate_web/controllers/detours_controller_test.exs +++ b/test/skate_web/controllers/detours_controller_test.exs @@ -460,24 +460,10 @@ defmodule SkateWeb.DetoursControllerTest do other_user = insert(:user) # Manually insert a detour by another user - Detours.upsert_from_snapshot(other_user.id, %{ - "context" => %{ - "route" => %{ - "id" => "23", - "name" => "23", - "directionNames" => %{ - "0" => "Outbound", - "1" => "Inbound" - } - }, - "routePattern" => %{ - "headsign" => "Headsign", - "directionId" => 0 - }, - "nearestIntersection" => "Street A & Avenue B", - "uuid" => 10 - } - }) + Detours.upsert_from_snapshot( + other_user.id, + build(:detour_snapshot) + ) conn = get(conn, ~p"/api/detours")