Sha256: 245612973055f734232663d1eba0d97412c9b6018ff705d6458a270c645551e2

Contents?: true

Size: 1.34 KB

Versions: 23

Compression:

Stored size: 1.34 KB

Contents

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', :access_token => 'AT')
      end

      
      describe ".geography_recent_media" do

        context "with geography ID passed" do

          before do
            stub_get("geographies/12345/media/recent.#{format}").
              with(:query => {:access_token => @client.access_token}).
              to_return(:body => fixture("geography_recent_media.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.geography_recent_media(12345)
            a_get("geographies/12345/media/recent.#{format}").
              with(:query => {:access_token => @client.access_token}).
              should have_been_made
          end

          it "should return a list of recent media items within the specifed geography" do
            recent_media = @client.geography_recent_media(12345)
            recent_media.should be_a Array
            recent_media.first.user.username.should == "amandavan"
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 4 rubygems

Version Path
instagram-community-maintained-1.1.6 spec/instagram/client/geography_spec.rb
instagram-1.1.6 spec/instagram/client/geography_spec.rb
instagram-1.1.5 spec/instagram/client/geography_spec.rb
instagram-1.1.4 spec/instagram/client/geography_spec.rb
instagram-1.1.3 spec/instagram/client/geography_spec.rb
instagram-1.1.2 spec/instagram/client/geography_spec.rb
instagram-1.1.1 spec/instagram/client/geography_spec.rb
instagram-1.1.0 spec/instagram/client/geography_spec.rb
instagram-1.0.0 spec/instagram/client/geography_spec.rb
instagram-0.11.0 spec/instagram/client/geography_spec.rb
instagram-0.10.0 spec/instagram/client/geography_spec.rb
instagram-0.9.1 spec/instagram/client/geography_spec.rb
instagram-0.9.0 spec/instagram/client/geography_spec.rb
instagram-0.8.5 spec/instagram/client/geography_spec.rb
instagram-0.8.4 spec/instagram/client/geography_spec.rb
instagram-0.8.3 spec/instagram/client/geography_spec.rb
instagram-0.8.2 spec/instagram/client/geography_spec.rb
instagram-fixed-0.8.1 spec/instagram/client/geography_spec.rb
instagram-fixed-0.8 spec/instagram/client/geography_spec.rb
instagram-innonate-0.8 spec/instagram/client/geography_spec.rb