Add indexed_by=maybe to cards (#2827)

* Add indexed_by=maybe to cards
This commit is contained in:
Rob Zolkos
2026-04-14 17:35:41 -04:00
committed by GitHub
parent 89a1cf43fb
commit abd59567e3
4 changed files with 12 additions and 1 deletions
@@ -29,6 +29,13 @@ class CardsControllerTest < ActionDispatch::IntegrationTest
assert_equal [ cards(:logo).number, cards(:layout).number, cards(:text).number ].sort, @response.parsed_body.pluck("number").sort
end
test "index as JSON can filter by maybe index" do
get cards_path(format: :json), params: { indexed_by: "maybe" }
assert_response :success
assert_equal [ cards(:buy_domain).number ], @response.parsed_body.pluck("number")
end
test "create a new draft" do
assert_difference -> { Card.count }, 1 do
post board_cards_path(boards(:writebook))
+3
View File
@@ -23,6 +23,9 @@ class FilterTest < ActiveSupport::TestCase
filter = users(:david).filters.new indexed_by: "closed"
assert_equal [ cards(:shipping) ], filter.cards
filter = users(:david).filters.new indexed_by: "maybe", board_ids: [ boards(:writebook).id ]
assert_equal [ cards(:buy_domain) ], filter.cards
cards(:shipping).postpone
filter = users(:david).filters.new indexed_by: "not_now"
assert_includes filter.cards, cards(:shipping)