Improve prompt and tests
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user