Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #126 from leonko/fix_utils_raw_request
Browse files Browse the repository at this point in the history
return utils_raw_response to life
  • Loading branch information
heatonjb committed Jul 29, 2014
2 parents a29c548 + 8d1884c commit 592d4c2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/instagram/client/utils.rb
Expand Up @@ -11,7 +11,7 @@ module Utils
# limit = response.headers[:x_ratelimit_limit]
#
def utils_raw_response
response = get('users/self/feed',nil,true)
response = get('users/self/feed',nil, false, true)
response
end

Expand All @@ -25,4 +25,4 @@ def get_username
end
end
end
end
end
32 changes: 32 additions & 0 deletions spec/instagram/client/utils_spec.rb
@@ -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

0 comments on commit 592d4c2

Please sign in to comment.