Files
fizzy/test/controllers/public/boards/columns/closeds_controller_test.rb
T
Mike Dalessio e27c0c5fa1 Filter draft cards from public closed column (#2667)
The public closed column was showing draft cards because it queried
`@board.cards.closed` without a `.published` filter. This adds the
missing `.published` scope to match the pattern used elsewhere in the
public controllers.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 20:31:41 -05:00

23 lines
635 B
Ruby

require "test_helper"
class Public::Boards::Columns::ClosedsControllerTest < ActionDispatch::IntegrationTest
setup do
boards(:writebook).publish
end
test "show" do
get public_board_columns_closed_path(boards(:writebook).publication.key)
assert_response :success
end
test "show excludes draft cards" do
draft_card = cards(:buy_domain)
draft_card.update!(status: :drafted)
Current.set(user: users(:david)) { draft_card.close }
get public_board_columns_closed_path(boards(:writebook).publication.key)
assert_response :success
assert_not_includes response.body, draft_card.title
end
end