Occassionally it is important to update VCR cassettes. This ensures that tests which rely on external service stubs from VCR are not returning false positives.
- ensure
.env.test
has the following benefit checker details pointing to staging - seevalues-staging.yaml
BC_LSC_SERVICE_NAME=
BC_CLIENT_ORG_ID=
BC_CLIENT_USER_ID=
BC_WSDL_URL=
BC_USE_DEV_MOCK=false
- ensure you switch
BC_USE_DEV_MOCK=false
when recording. You can switchBC_USE_DEV_MOCK=true
after recording or leave to use staging.
- connect to VPN
- set PROVIDER_DETAILS_URL
- ensure Rails.configuration.x.provider_details points to staging for the test
- check staging actually works (it has not in the past)
- ensure
.env.test
hasORDNANCE_SURVEY_API_KEY
set
- ensure
.env.test
hasLEGAL_FRAMEWORK_API_HOST
pointing to staging environment
You can rerun the entire test suite but it may be preferable to add and commit specs and feature cassettes separately.
To rerecord all cassettes by appending [not recommended] you can use:
VCR_RECORD_MODE=all bundle exec rake
To recreate all cassettes [recommended] you can use:
rm -rf spec/cassettes/ features/cassettes/
bundle exec rake
Note: because you have deleted the cassettes the default recording mode of :once
means it will rerecord
rm -rf spec/cassettes/
bundle exec rspec -fp
rm -rf features/cassettes/
bundle exec cucumber