Sha256: 1bc3057099090b90220896b8d48c7582245f74f3b7132878e489bd878cf162c2

Contents?: true

Size: 1.32 KB

Versions: 5

Compression:

Stored size: 1.32 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(12_345)
            expect(a_get("geographies/12345/media/recent.#{format}")
              .with(query: { access_token: @client.access_token }))
              .to have_been_made
          end

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

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
instagram-continued-continued-1.5.0 spec/instagram/client/geography_spec.rb
instagram-continued-1.4.0 spec/instagram/client/geography_spec.rb
instagram-continued-1.3.3 spec/instagram/client/geography_spec.rb
instagram-continued-1.3.2 spec/instagram/client/geography_spec.rb
instagram-continued-1.3.1 spec/instagram/client/geography_spec.rb