Created
March 21, 2011 01:54
-
-
Save jonhoman/878902 to your computer and use it in GitHub Desktop.
VCR RSpec examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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