Improve prompt and tests

This commit is contained in:
Jorge Manrubia
2025-05-16 14:49:51 +02:00
parent 3ccfc165b2
commit a5de913608
16 changed files with 7009 additions and 4742 deletions
@@ -3,6 +3,8 @@ require "test_helper"
class Command::Ai::TranslatorTest < ActionDispatch::IntegrationTest
include VcrTestHelper
vcr_record!
setup do
@user= users(:david)
end
@@ -39,6 +41,13 @@ class Command::Ai::TranslatorTest < ActionDispatch::IntegrationTest
assert_command({ context: { indexed_by: "latest" } }, "cards with recent activity")
end
test "filter by card id" do
# List context
assert_command({ context: { card_ids: [ 123 ] } }, "card 123")
assert_command({ context: { card_ids: [ 123, 456 ] } }, "card 123, 456")
assert_command({ context: { terms: [ "123" ] } }, "123") # Notice existing cards will be intercepted earlier
end
test "getting insight on cards" do
# Card context
assert_command({ commands: [ "/insight summarize" ] }, "summarize", context: :card)
+6
View File
@@ -3,6 +3,10 @@ require "test_helper"
class Command::GoToCardTest < ActionDispatch::IntegrationTest
include CommandTestHelper
include VcrTestHelper
vcr_record!
setup do
@card = cards(:logo)
end
@@ -15,6 +19,8 @@ class Command::GoToCardTest < ActionDispatch::IntegrationTest
test "result in a regular search if the card does not exist" do
command = parse_command "123"
puts command.commands.first.inspect
assert command.valid?
result = command.execute