Skip to content

Commit

Permalink
test(thread-contoller): unsticky thread test
Browse files Browse the repository at this point in the history
  • Loading branch information
akinsey committed Aug 1, 2024
1 parent d93de51 commit 9e79d24
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/epochtalk_server_web/controllers/thread_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,24 @@ defmodule Test.EpochtalkServerWeb.Controllers.Thread do
assert response["sticky"] == true
assert response["thread_id"] == thread_id
end

@tag authenticated: :global_mod
test "given thread that authenticated user moderates, does unsticky thread", %{
conn: conn,
thread: %{post: %{thread_id: thread_id}}
} do
conn
|> post(Routes.thread_path(conn, :sticky, thread_id), %{"sticky" => true})
|> json_response(200)

response =
conn
|> post(Routes.thread_path(conn, :sticky, thread_id), %{"sticky" => false})
|> json_response(200)

assert response["sticky"] == false
assert response["thread_id"] == thread_id
end
end

describe "purge/2" do
Expand Down

0 comments on commit 9e79d24

Please sign in to comment.