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
0
votes
2 answers

Setting up VCR for Rails

I'm currently trying to get VCR to run correctly for my app. Right now everything seems to be configured right but I must be missing something because when the test that uses the VCR.use_cassette is not render the response in the yml file I have set…
Bitwise
  • 8,021
  • 22
  • 70
  • 161
0
votes
1 answer

Where and how to expect on Rspec / VCR stubbed response?

I'm writing a client in ruby for an API that we're using. We use rspec and VCR with webmock to mock request/responses to the API. What is the best or appropriate way to test the response back from the API when the response payload is really…
doremi
  • 14,921
  • 30
  • 93
  • 148
0
votes
1 answer

VCR re-recording cassette does not persist

Thanks in advance - i'm recording a controller spec with vcr. The problem: The first time I run my spec, it records fine, then I delete my_spec_context_dir, re-run the spec, and no cassette is saved under the cassettes dir! The gems: gem…
seanriordan08
  • 296
  • 3
  • 14
0
votes
1 answer

VCR with Cucumber for Braintree

I am using Cucumber to test Braintree integration (for credit card payments) in a Rails 3.2 app. I am trying to add VCR gem to record the response from Braintree for the specs. When i run the tagged scenario, it passes and records the…
ppj
  • 1
  • 2
0
votes
0 answers

Testing internal api calls with VCR gem

I am using rspec with capybara for testing. I want to test my api end point, I can do it with rspec. But while searching on net for api testing I found a gem vcr which can save api call response in yml file, So no multiple hit on server and also…
Dipak Gupta
  • 7,321
  • 1
  • 20
  • 32
0
votes
2 answers

How can I stub a dependency in a Rails service

I have: a web service wrapper that calls a 3rd party API (lib) a service that calls that wrapper and does some finagling (service) Testing the lib class with VCR works great, but I am not sure how to test the service. Specifically, how can I stub…
blu
  • 12,905
  • 20
  • 70
  • 106
0
votes
1 answer

Flickraw & VCR give unexpected results

I´m using VCR to test a method which gets a list of photosets from Flickr require 'rails_helper' RSpec.describe Photoset, type: :model do # ... describe '.import' do it "gets photosets" do VCR.use_cassette('photosets_getList') do …
max
  • 96,212
  • 14
  • 104
  • 165
0
votes
1 answer

VCR is not recording cassettes on successful requests, only on failed ones

I have a simple test to fetch one Facebook object. I'm using Curl for the request. it "gets an object from Facebook" do VCR.use_cassette('facebook') do url = "https://graph.facebook.com/?access_token=#{@access_token}&#{query_string}" …
shadowmaru
  • 141
  • 1
  • 9
0
votes
1 answer

VCR does not record cassettes using faraday

I have scoured the internet for an answer to this, including most of the other "suggested" questions on SO. I have configured VCR in rspec, but when running the tests VCR never records a tape (tape dir remains empty) and runs the HTTP request every…
camdub
  • 867
  • 1
  • 10
  • 22
0
votes
1 answer

rails/VCR gem, same URI different method clash

My VCR configure block is: VCR.configure do |c| c.cassette_library_dir = 'spec/fixtures/vcr_cassettes' c.hook_into :webmock c.around_http_request(lambda { |req| req.uri =~ /google.com/ }) do |request| VCR.use_cassette(request.uri,…
Christian-G
  • 2,371
  • 4
  • 27
  • 47
0
votes
1 answer

Recycle recorded vcr cassettes in similar scenario OR tell vcr to use specific cassette for a scenario

i have to extend an exsiting cucumber feature with some new scenarios covering some new behaviour. At the moment this whole cucumber/vcr thingy is set up as such that it will look for cassettes with matching scenario name: feature bar @vcr …
jethroo
  • 2,086
  • 2
  • 18
  • 30
0
votes
1 answer

Filter sensitive data with VCR issue?

I'm using VCR to filter the username and password of a client in a project I'm developing right now, but for some dumb reason, the client used the website's domain as the password. (for example, say I'm trying to log into www.fakewebsite.com, the…
Sam Lehman
  • 343
  • 3
  • 8
0
votes
2 answers

How can I use Sinatra to simulate a remote server in RSpec / VCR?

The VCR Cucumber documents show many examples using a tiny Sinatra app to simulate a remote server, using a function called start_sinatra_app loaded from vcr_cucumber_helpers.rb. I'd like use something like that for my Rails / RSpec / VCR testing,…
fearless_fool
  • 33,645
  • 23
  • 135
  • 217
0
votes
2 answers

Testing javascript refreshes using multiple VCR cassettes

I'm using Capybara and Poltergeist to test an index page that uses setTimeout to periodically refresh page content. The page content transitions between three states, based on an external service, and I've got a cassette for each of these…
0
votes
0 answers

Reasons why a VCR request is unhandled on one machine and not another

When I run the tests on my local environment they are all pass. However, when the tests run on a different machine, many of the VCR related tests are failing. I want to investigate the cause of this. My guess is that the requests that are running…
Venkat D.
  • 2,979
  • 35
  • 42
1 2 3
11
12