-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jackson Pires
authored and
Jackson Pires
committed
Nov 19, 2017
1 parent
ecc3db8
commit 675787a
Showing
5 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
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
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
67 changes: 67 additions & 0 deletions
67
test_app/spec/fixtures/vcr_cassettes/jsonplaceholder/posts.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
describe 'HTTParty' do | ||
it 'content-type' do | ||
stub_request(:get, "https://jsonplaceholder.typicode.com/posts/2"). | ||
to_return(status: 200, body: "", headers: { 'content-type': 'application/json'}) | ||
#stub_request(:get, "https://jsonplaceholder.typicode.com/posts/2"). | ||
# to_return(status: 200, body: "", headers: { 'content-type': 'application/json'}) | ||
|
||
response = HTTParty.get('https://jsonplaceholder.typicode.com/posts/2') | ||
content_type = response.headers['content-type'] | ||
expect(content_type).to match(/application\/json/) | ||
VCR.use_cassette("jsonplaceholder/posts") do | ||
response = HTTParty.get('https://jsonplaceholder.typicode.com/posts/2') | ||
content_type = response.headers['content-type'] | ||
expect(content_type).to match(/application\/json/) | ||
end | ||
end | ||
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