Refine when to filter by cards, make it more relaxes with the expressions it accepts

This commit is contained in:
Jorge Manrubia
2025-07-23 18:38:47 +02:00
parent 8febb2b3a1
commit 6080c2aa9b
23 changed files with 165758 additions and 297 deletions
+12 -1
View File
@@ -7,9 +7,13 @@ class Command::Ai::TranslatorTest < ActionDispatch::IntegrationTest
@user = users(:david)
end
vcr_record!
test "filter by assignments" do
# List context
assert_command({ context: { assignee_ids: [ "jz" ] } }, "cards assigned to jz")
assert_command({ context: { assignee_ids: [ "jz" ] } }, "issues assigned to jz")
assert_command({ context: { assignee_ids: [ "jz" ] } }, "bugs assigned to jz")
assert_command({ context: { assignee_ids: [ "kevin" ] } }, "stuff assigned to kevin")
assert_command({ context: { assignee_ids: [ "jz" ] } }, "assigned to jz")
assert_command({ context: { assignment_status: "unassigned" } }, "unassigned cards")
@@ -21,6 +25,14 @@ class Command::Ai::TranslatorTest < ActionDispatch::IntegrationTest
assert_command({ context: { assignee_ids: [ "jz" ] } }, "cards assigned to jz", context: :card)
end
test "filter by terms" do
assert_command({ context: { terms: [ "backups" ] } }, "cards about backups")
assert_command({ context: { terms: [ "cables" ] } }, "issues about cables")
assert_command({ context: { terms: [ "infrastructure" ] } }, " infrastructure bugs")
assert_command({ context: { terms: [ "infrastructure" ] } }, " bugs about infrastructure")
assert_command({ context: { terms: [ "infrastructure" ] } }, " infrastructure stuff")
end
test "filter by tag" do
# List context
assert_command({ context: { tag_ids: [ "design" ] } }, "cards tagged with design")
@@ -151,7 +163,6 @@ class Command::Ai::TranslatorTest < ActionDispatch::IntegrationTest
test "default to search" do
assert_command({ commands: [ "/search backups" ] }, "backups")
assert_command({ context: { terms: [ "backups" ] } }, "cards about backups")
end
test "combine commands and filters" do