Skip to content

Instantly share code, notes, and snippets.

@jonhoman
Created March 21, 2011 01:54
Show Gist options
  • Save jonhoman/878902 to your computer and use it in GitHub Desktop.
Save jonhoman/878902 to your computer and use it in GitHub Desktop.
VCR RSpec examples
describe Feed do
let :feed do
Factory :feed
end
it "is not valid without a name" do
feed.name = nil
feed.should_not be_valid
end
end
# FAIL: feed makes an http request behind the scenes
describe Feed do
use_vcr_cassette "feed"
let :feed do
Factory :feed
end
it "is not valid without a name" do
feed.name = nil
feed.should_not be_valid
end
end
# SUCCESS: VCR recorded the interaction and will use that recording in the future
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment