From 2d40aa82cf3211aceef35226d42b6e632fa44dba Mon Sep 17 00:00:00 2001 From: Hannah Purcell Date: Fri, 10 Jan 2025 12:38:55 -0500 Subject: [PATCH] fix: no need to use controller for that channel test! use build detour with author --- test/skate_web/channels/detours_channel_test.exs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/skate_web/channels/detours_channel_test.exs b/test/skate_web/channels/detours_channel_test.exs index 8508ee310..6fc74271c 100644 --- a/test/skate_web/channels/detours_channel_test.exs +++ b/test/skate_web/channels/detours_channel_test.exs @@ -146,16 +146,17 @@ defmodule SkateWeb.DetoursChannelTest do end @tag :authenticated - test "subscribes to draft detours with initial detours", %{conn: conn, socket: socket} do + test "subscribes to draft detours with initial detours", %{ + conn: conn, + socket: socket, + user: user + } do %{id: authenticated_user_id} = SkateWeb.AuthManager.Plug.current_resource(conn) :detour |> build() |> with_id(1) |> insert() :detour |> build() |> with_id(2) |> insert() :detour |> build() |> with_id(3) |> insert() - - put(conn, ~p"/api/detours/update_snapshot", %{ - "snapshot" => :detour_snapshot |> build() |> with_id(4) - }) + :detour |> build(author: user) |> with_id(4) |> insert() assert {:ok, %{