Sha256: 04b9daef9c6c0afcebef1ada41a16dada6bdd5b7bcea55bf6b5a783c2bdd04e7

Contents?: true

Size: 1.32 KB

Versions: 13

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 ".oembed" do
        before do
          stub_get("oembed").
            with(:query => {:access_token => @client.access_token, :url => "http://instagram.com/p/abcdef"}).
            to_return(:body => fixture("oembed.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
        end

        it "should get the correct resource" do
          @client.oembed("http://instagram.com/p/abcdef")
          a_get("oembed?url=http://instagram.com/p/abcdef").
            with(:query => {:access_token => @client.access_token}).
            should have_been_made
        end

        it "should return the oembed information for an instagram media url" do
          oembed = @client.oembed("http://instagram.com/p/abcdef")
          oembed.media_id.should == "123657555223544123_41812344"
        end

        it "should return nil if a URL is not provided" do
          oembed = @client.oembed
          oembed.should be_nil
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
instagram-community-maintained-1.1.6 spec/instagram/client/embedding_spec.rb
instagram-1.1.6 spec/instagram/client/embedding_spec.rb
instagram-1.1.5 spec/instagram/client/embedding_spec.rb
instagram-1.1.4 spec/instagram/client/embedding_spec.rb
instagram-1.1.3 spec/instagram/client/embedding_spec.rb
instagram-1.1.2 spec/instagram/client/embedding_spec.rb
instagram-1.1.1 spec/instagram/client/embedding_spec.rb
instagram-1.1.0 spec/instagram/client/embedding_spec.rb
instagram-1.0.0 spec/instagram/client/embedding_spec.rb
instagram-0.11.0 spec/instagram/client/embedding_spec.rb
instagram-0.10.0 spec/instagram/client/embedding_spec.rb
instagram-0.9.1 spec/instagram/client/embedding_spec.rb
instagram-0.9.0 spec/instagram/client/embedding_spec.rb