Skip to content

Instantly share code, notes, and snippets.

@kitwalker12
Created August 15, 2013 21:20
Show Gist options
  • Save kitwalker12/6245012 to your computer and use it in GitHub Desktop.
Save kitwalker12/6245012 to your computer and use it in GitHub Desktop.
Rspec & VCR to mock API calls
require 'spec_helper'
feature "My Feature: " do
context "User Registers" do
scenario "through api" do
VCR.use_cassette "register_new_user", :record => :new_episodes do
#make api call
end
end
end
end
#..
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
#...
end
require 'vcr'
VCR.configure do |c|
c.cassette_library_dir = 'spec/vcr'
c.hook_into :webmock
c.default_cassette_options = { :record => :none }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment