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

Rails Minitest API connection - NoMethodError: undefined method `call'

I want to create a Minitest for service responsible for creating data inside of external provider and updating few things in my db. To do so I'm using VCR and below test: #test/services/identity_checks/check_creator_test.rb require…
mr_muscle
  • 2,536
  • 18
  • 61
0
votes
1 answer

VCR failing to record subsequent requests

I have a system spec whose code under test makes 2 external HTTP requests. I'm wrapping my whole test with VCR.use_cassette, but for whatever reason VCR is only recording the first of my two requests. Here's my test. RSpec.describe 'Adding external…
Jason Swett
  • 43,526
  • 67
  • 220
  • 351
0
votes
0 answers

Switching form to remote: true breaks VCR

I have a test that looks like this. RSpec.describe 'Modify visit summary letters', type: :system do scenario 'with one correspondence relationship' do VCR.use_cassette 'correspondence/faxes/valid_number' do # test steps omitted for…
Jason Swett
  • 43,526
  • 67
  • 220
  • 351
0
votes
2 answers

Expressions can only be used to update, not to insert

i got this issue when trying to create object using Factory boy and unittest.mock for mocking payment self = , field = value =…
user13834974
0
votes
1 answer

Why are records not being stored to the db when testing with VCR?

I have an interactor foo with method perform on it which makes an API call, and records the response through ActiveRecord. It works fine. I have a spec for it that triggers the method with FactoryBot data, then checks the db for the expected…
kolosy
  • 3,029
  • 3
  • 29
  • 48
0
votes
1 answer

Ruby VCR gem disable re recording when a recording is available

I want to record the API response once and use is forever but it seems like VCR wants to re-record after sometime is elapsed. I tried to google how to disable it. Found re_record_interval but it seems like not working. My current VCS setup…
Kshitij
  • 353
  • 3
  • 10
0
votes
1 answer

RSpec check if message has been sent on Slack

I've got a class which is responsible for send a direct message on Slack to every reporter who has not updated his Jira ticket in 2 days. To send message, described class used send_message method (which underneath is HTTParty.post). I'mc using VCR…
mr_muscle
  • 2,536
  • 18
  • 61
0
votes
1 answer

Create http fixtures simulating request coming from outside

I have a rails app with some rspec feature tests. This app Alice works in tandem with another program Bob When i want to use Bob, i create a json file in a specific url with instructions in my Alice app. Bob then fetches this json file with HTTP…
Sacha
  • 75
  • 5
0
votes
1 answer

VCR cassette Rails

My product keys are encrypted using aws kms. Can I create a cassette with my credentials for aws and then use same answer for other credentials? To encrypt key, I send a plaintext to kms, ciphertextblob comes in response. For decryption, on…
RomanOks
  • 692
  • 3
  • 13
0
votes
1 answer

is it possible to use ruby vcr gem without passing a block of code

I want to use Cypress as a testing tool with the cypress-on-rails plugin. However during a cypress scenario I want to enable/wrap all rails backend requests with vcr so all requests are captured and replayed. Typically you would tag a rspec or…
theog
  • 2,062
  • 2
  • 14
  • 13
0
votes
1 answer

Can we register multiple custom request matchers while using VCR.py (cassette recording for python)?

If the answer is yes, then an example on how to use them will be great. Am referring to the below part of documentation: http://vcrpy.readthedocs.io/en/latest/advanced.html#register-your-own-request-matcher
Viral Modi
  • 1,957
  • 1
  • 9
  • 18
0
votes
1 answer

vcr.py store call from twitter api

I want to use https://github.com/bear/python-twitter/ and check API requests https://github.com/kevin1024/vcrpy or https://github.com/agriffis/vcrpy-unittest. From lines 30: https://github.com/bear/python-twitter/blob/master/twitter/api.py#L30 30:…
Dimitrios Mistriotis
  • 2,626
  • 3
  • 28
  • 45
0
votes
1 answer

Playing a cassete whose request is not inside the use_cassete scope using VCR for Rails

I've built an API (MyAPI) that connects to an external API for authentication (ExAPI). For all the requests to MyAPI where the user needs to be authenticated, he sends a cookie with a token that is then sent to ExAPI, and then it gets the user…
Tiago
  • 673
  • 1
  • 8
  • 24
0
votes
1 answer

Working with mutable values in vcr

I have a vcr casette like this --- http_interactions: - request: method: post uri: https://control.msg91.com/api/sendotp.php?message=Your%20otp%20is%200805&mobile=919446733017&otp=0805&sender=TESTER body: encoding: UTF-8 …
Abhilash
  • 2,864
  • 3
  • 33
  • 67
0
votes
1 answer

How can I use VCR with Rails 5.1 system tests?

Many things on the web seem to suggest that VCR can be used with Capybara. I have three problems. This doesn't make much sense to me, because the test driver and the application code don't share memory. I'm not finding full recipes on how to set…
John Bachir
  • 22,495
  • 29
  • 154
  • 227