Rails: Measures when VCR says that the request content is not enough
An HTTP request has been made that VCR does not know how to handle: GET http://example.com
When I get this error. If you open the YAML file generated by VCR and look at it, the content of the request should be insufficient.
Originally
- request: method: get uri: http://example.com
There should be a line called
For the content of the request you are about to send. This error occurs when the content of the cache file is insufficient.
In this case as a solution. You should delete the cache file once and create a new one.
Why did you come to this case? The application uses the cache function, and a VCR cache file is generated with some requests missing.
Because "application-side caching" is enabled or disabled depending on the situation. "VCR file missing request content" and "operation when trying to request everything" are different, and an error occurred accidentally.
VCR files should be created with the caching feature disabled. Because an error occurs only when the contents of the cache file are "insufficient". There is no problem if there are many. (Probably)
Original by
Rails : VCRでリクエスト内容が足りないと言われる時の対策
About
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。
公開日時
2019-04-16
Discussion