Add API for creating and updating boards

This commit is contained in:
Stanko K.R.
2025-12-09 12:52:14 +01:00
parent f3ff0c605e
commit 1a24c1373c
2 changed files with 33 additions and 5 deletions
@@ -211,4 +211,23 @@ class BoardsControllerTest < ActionDispatch::IntegrationTest
assert_response :created
assert_equal board_path(Board.last, format: :json), @response.headers["Location"]
end
test "update as JSON" do
board = boards(:writebook)
put board_path(board), params: { board: { name: "Updated Name" } }, as: :json
assert_response :no_content
assert_equal "Updated Name", board.reload.name
end
test "destroy as JSON" do
board = boards(:writebook)
assert_difference -> { Board.count }, -1 do
delete board_path(board), as: :json
end
assert_response :no_content
end
end