Add a clear command to clear filters

This commit is contained in:
Jorge Manrubia
2025-05-08 10:20:57 +02:00
parent 06ed269ef8
commit d10c45772e
4 changed files with 39 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
require "test_helper"
class Command::FilterTest < ActionDispatch::IntegrationTest
include CommandTestHelper
setup do
Current.session = sessions(:david)
end
test "clear the filters keeping the selected collections" do
result = execute_command "/clear", context_url: "?card_ids%5B%5D=1&card_ids%5B%5D=2&collection_ids%5B%5D=#{collections(:writebook).id}&indexed_by=newest&terms%5B%5D=jorge"
assert_equal cards_path(indexed_by: "newest", collection_ids: [ collections(:writebook).id ]), result.url
end
end