Sha256: a3a6384b728f03e2353fd826f3050fd46bc2d4aeb241853451f53eb2687b6ba0

Contents?: true

Size: 1 KB

Versions: 10

Compression:

Stored size: 1 KB

Contents

require File.expand_path('../../spec_helper', __FILE__)

describe Instagram::Client do
  it "should connect using the endpoint configuration" do
    client = Instagram::Client.new
    endpoint = URI.parse(client.endpoint)
    connection = client.send(:connection).build_url(nil).to_s
    expect(connection).to eq(endpoint.to_s)
  end

  it "should not cache the user account across clients" do
    stub_get("users/self.json").
      with(:query => {:access_token => "at1"}).
      to_return(:body => fixture("shayne.json"), :headers => {:content_type => "application/json; charset=utf-8"})
    client1 = Instagram::Client.new(:access_token => "at1")
    expect(client1.send(:get_username)).to eq("shayne")
    stub_get("users/self.json").
      with(:query => {:access_token => "at2"}).
      to_return(:body => fixture("mikeyk.json"), :headers => {:content_type => "application/json; charset=utf-8"})
    client2 = Instagram::Client.new(:access_token => "at2")
    expect(client2.send(:get_username)).to eq("mikeyk")
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
extendi-instagram-2.0.6 spec/instagram/client_spec.rb
extendi-instagram-2.0.5 spec/instagram/client_spec.rb
extendi-instagram-2.0.4 spec/instagram/client_spec.rb
extendi-instagram-2.0.3 spec/instagram/client_spec.rb
extendi-instagram-2.0.2 spec/instagram/client_spec.rb
extendi-instagram-2.0.1 spec/instagram/client_spec.rb
extendi-instagram-2.0.0 spec/instagram/client_spec.rb
instagram-continued-1.3.0 spec/instagram/client_spec.rb
instagram-continued-1.2.1 spec/instagram/client_spec.rb
instagram-continued-1.2.0 spec/instagram/client_spec.rb