ウェブサービスを作っています。

VCR で、タイムスタンプなどの動的パラメータを無視する

VCR 4.0.0 + RSpec 3.7.0 で確認しています。


spec/support/vcr.rb

VCR.configure do |c|
  c.cassette_library_dir = 'spec/cassettes'
  c.hook_into :webmock
  c.configure_rspec_metadata!
end

spec

vcr_options = {
  cassette_name: '...',
  match_requests_on: [:method, VCR.request_matchers.uri_without_params(:signature, :timestamp)]
}
it 'this is test...', vcr: vcr_options do
  ...
end

参考