Support selecting multiple cards by using a list of numbers (separated by comma, or space)
https://3.basecamp.com/2914079/buckets/37331921/todos/8620236700#__recording_8620273944
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
require "test_helper"
|
||||
|
||||
class Command::FilterCardsTest < ActionDispatch::IntegrationTest
|
||||
include CommandTestHelper
|
||||
|
||||
setup do
|
||||
@card_ids = cards(:logo, :layout).collect(&:id)
|
||||
end
|
||||
|
||||
test "redirects to the cards index filtering by cards" do
|
||||
result = execute_command "#{@card_ids.join(" ")}"
|
||||
|
||||
assert_equal cards_path(indexed_by: "newest", card_ids: @card_ids), result.url
|
||||
end
|
||||
|
||||
test "respects existing filters" do
|
||||
result = execute_command "#{@card_ids.join(",")}", context_url: "http://37signals.fizzy.localhost:3006/cards?collection_ids%5B%5D=#{collections(:writebook).id}"
|
||||
|
||||
assert_equal cards_path(indexed_by: "newest", collection_ids: [ collections(:writebook).id ], card_ids: @card_ids), result.url
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user