Skip to content

Commit

Permalink
Address code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-bernhardt committed Aug 8, 2024
1 parent b1cb436 commit 102b158
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ There is a `Makefile` that contains some useful command shortcuts for typical de

To see a current list of commands, run `make help`.

### Generating cassettes for tests

We use [VCR](https://github.com/vcr/vcr) to record transactions with remote systems for testing. This includes the rake
task for reloading Detector::SuggestedResource records, which do not yet have a standard provider. For the initial
feature development, we have used a Lando environment with the following definition:

```yml
name: static
recipe: lamp
config:
webroot: .
```
If you need to regenerate these cassettes, the following procedure should be sufficient:
1. Use the configuration above to ensure the needed files are visible at `http://static.lndo.site/filename.ext`.
2. Delete any existing cassette files which need to be regenerated.
3. Run the test(s).
4. Commit the resulting files along with your other work.

## Environment Variables

### Required
Expand Down
3 changes: 2 additions & 1 deletion app/models/detector/suggested_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def calculate_fingerprint(old_phrase)
# @note This method is called by the suggested_resource:reload rake task.
#
# @param input [CSV::Table] An imported CSV file containing all Suggested Resource records. The CSV file must have
# at least three headers, named "Title", "URL", and "Phrase".
# at least three headers, named "Title", "URL", and "Phrase". Please note: these values
# are case sensitive.
def self.bulk_replace(input)
raise ArgumentError.new, 'Tabular CSV is required' unless input.instance_of?(CSV::Table)

Expand Down

0 comments on commit 102b158

Please sign in to comment.