When working with API clients there are several distinct areas of concern. Each of these happen in sequence and are used with the goal of receiving a Domain Model at the end.
This file contains 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
<?php | |
// Ignore errors | |
libxml_use_internal_errors(true) AND libxml_clear_errors(); | |
// http://stackoverflow.com/q/10237238/99923 | |
// http://stackoverflow.com/q/12034235/99923 | |
// http://stackoverflow.com/q/8218230/99923 | |
// original input (unknown encoding) |
This file contains 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
# 1) Use VCR.use_cassette in your let block. This will use | |
# the cassette just for requests made by creating bar, not | |
# for anything else in your test. | |
let(:foo) { VCR.use_cassette("foo") { create(:bar) } } | |
it "uses foo" do | |
foo | |
end | |
# 2) Wrap the it block that uses #foo in VCR.use_cassette. |