Questions tagged [vcr]

VCR is a ruby tool that facilitates testing HTTP-dependent code by recording HTTP interactions for future playback.

For more information: https://github.com/vcr/vcr

178 questions
44
votes
2 answers

VCRProxy: Record PhantomJS ajax calls with VCR inside Capybara

I already did some research in this field, but didn't find any solution. I have a site, where asynchron ajax calls are made to facebook (using JSONP). I'm recording all my HTTP requests on the Ruby side with VCR, so I thought it would be cool, to…
23tux
  • 14,104
  • 15
  • 88
  • 187
21
votes
3 answers

Is there a python alternative to Ruby's VCR library?

I'd like to use the awesome "record/playback" mechanism of Ruby's VCR library or Betamax for the JVM. Is there a Python library that works the same way? If not, how do you test your REST client calls without worrying about the test being slow and…
David Ackerman
  • 12,649
  • 6
  • 24
  • 19
20
votes
2 answers

Filtering sensitive data with VCR

I'm using VCR gem to record http interactions and replay them in future. I want to filter-out my actual password value in the uri request. Here's sample of what the uri looks…
keruilin
  • 16,782
  • 34
  • 108
  • 175
18
votes
3 answers

How to edit response body returned by VCR gem?

I'm using VCR to record responses from other systems that i'm integrating with. But, this response get a huge JSON an VCR is saving it in a binary format: body: encoding: ASCII-8BIT string: !binary |- …
Cleyton
  • 2,338
  • 6
  • 23
  • 39
16
votes
5 answers

Node.js: Testing with VCR

Is there a VCR testing system for node.js?
donald
  • 23,587
  • 42
  • 142
  • 223
15
votes
1 answer

Using multiple cassettes with VCR in one test

I am using VCR to record http interactions with an external API. This is my (working) code: it 'does xyz....' do hook_payload = {ruby_hash: 'here'} VCR.use_cassette('my_folder/create_project') do …
jjjjjjjj
  • 4,203
  • 11
  • 53
  • 72
14
votes
2 answers

vcr with capybara-webkit

I'm using capybara-webkit to test integration with a third party website (I need javascript). I want to use vcr to record requests made during the integration test but capybara-webkit doesn't go over net http so vcr is unable to record them. How…
opsb
  • 29,325
  • 19
  • 89
  • 99
13
votes
3 answers

Java alternative for Ruby's vcr?

Is there a java alternative for Ruby's VCR? As far as I understand, the benefits of using VCR are immense, you can run an "integration test" and record the results, store them some where locally. Now from the next time when you need to run your…
zengr
  • 38,346
  • 37
  • 130
  • 192
12
votes
4 answers

Ruby VCR gem keeps recording the same requests

In my cucumber support directory I have the following in vcr.rb: require 'vcr' VCR.configure do |c| c.cassette_library_dir = 'fixtures/vcr_cassettes' c.hook_into :webmock c.ignore_localhost = true c.default_cassette_options = { record:…
Erik J
  • 828
  • 9
  • 22
11
votes
1 answer

Using vcr to stub ViewPoint gem returns Unauthorize response from ews API

I am stubbing all requests that go through the ViewPoint gem. Using the vcr gem. require 'spec_helper' require 'vcr' describe CalendarImporters::Ews::Get do let(:conf_connection) { FactoryGirl.create(:conf_connection)} let(:calendar) {…
DickieBoy
  • 4,886
  • 1
  • 28
  • 47
11
votes
5 answers

Turn VCR off for Specific Specs

How can I tell VCR that I want it to completely ignore a spec file? I've read a post on Google Groups that suggests either allowing real HTTP requests, or turning VCR off explicitly. What would be much more usable in my opinion would be for VCR to…
DeejUK
  • 12,891
  • 19
  • 89
  • 169
11
votes
2 answers

Stripe - add an invalid card to customer in test mode?

I would like to test invoice.payment_failed event with VCR Pseudocode: create a customer with invalid card create an invoice with invoice item (here the invoice gets automatically paid) fetch the invoice.payment_failed event with Stripe::Event In…
11
votes
1 answer

VCR not recording cassettes

I have a very simple module I'm testing with Ruby using the VCR gem. I've configured VCR according to the documentation but cannot seem to get a cassette to record in the cassette directory. I've even changed the permissions on the cassette…
brycemcd
  • 4,343
  • 3
  • 26
  • 29
10
votes
1 answer

Multiple HTTP requests matchable in one VCR cassette for rspec tests

I have a spec file with an expectation that a controller action will return success. The POST api/v1/users/:id/features/block action in the controller calls two HTTP calls on an external API, the only difference being in the body. I've put the two…
bdx
  • 3,316
  • 4
  • 32
  • 65
9
votes
1 answer

Testing a web API using RSpec and VCR

I'm writing an API wrapper as a gem, and I want to test API responses using RSpec. The problem with this is that all API requests are made using GET, and contain an API key in the url: e.g. game/metadata/{api_key} This presents problems for testing,…
Andrew Stewart
  • 710
  • 1
  • 6
  • 10
1
2 3
11 12