Skip to content

Commit

Permalink
fix: no need to use controller for that channel test! use build detou…
Browse files Browse the repository at this point in the history
…r with author
  • Loading branch information
hannahpurcell committed Jan 10, 2025
1 parent 2fd43d5 commit 2d40aa8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/skate_web/channels/detours_channel_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
%{
Expand Down

0 comments on commit 2d40aa8

Please sign in to comment.