Comment AI in tests

This commit is contained in:
Jorge Manrubia
2025-05-16 17:01:57 +02:00
parent 19d0ee8c68
commit 202088fc8e
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -29,6 +29,12 @@ Card.find_each(&:refresh_search_embedding)
Comment.find_each(&:refresh_search_embedding)
```
### Tests
For testing OpenAI API requests, we use [VCR](https://github.com/vcr/vcr). If you want to test AI features exercising the API, you need to place the `config/credentials/test.key`
that you can get from 1Password in "Fizzy - test.key". Then, when running tests that use Open AI API, you must either set the env variable VCR_RECORD=1
or to add `vcr_record!` to the test. See `VcrTestHelper`.
## Running tests
For fast feedback loops, unit tests can be run with:
+1
View File
@@ -24,6 +24,7 @@ builder:
env:
secret:
- SECRET_KEY_BASE
- OPEN_AI_API_KEY
aliases:
console: app exec -i --reuse "bin/rails console"