This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from leonko/fix_utils_raw_request
return utils_raw_response to life
- Loading branch information
Showing
2 changed files
with
34 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
describe Instagram::Client do | ||
Instagram::Configuration::VALID_FORMATS.each do |format| | ||
context ".new(:format => '#{format}')" do | ||
|
||
before do | ||
@client = Instagram::Client.new(:format => format, :client_id => 'CID', :client_secret => 'CS', :client_ips => '1.2.3.4', :access_token => 'AT') | ||
end | ||
|
||
describe '.utils_raw_response' do | ||
before do | ||
stub_get("users/self/feed.#{format}"). | ||
with(:query => {:access_token => @client.access_token}). | ||
to_return(:body => fixture("user_media_feed.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"}) | ||
end | ||
|
||
before(:each) do | ||
@response = @client.utils_raw_response | ||
end | ||
|
||
it 'return raw data' do | ||
expect(@response).to be_instance_of(Faraday::Response) | ||
end | ||
|
||
it 'response content headers' do | ||
expect(@response).to be_respond_to(:headers) | ||
end | ||
end | ||
end | ||
end | ||
end |