Sha256: da65259b9cc045b7bda1c60d23e28d8bb035aea3f4d505e37101948cb871b5a8

Contents?: true

Size: 1013 Bytes

Versions: 10

Compression:

Stored size: 1013 Bytes

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
    connection.should == 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")
    client1.send(:get_username).should == "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")
    client2.send(:get_username).should == "mikeyk"
  end
end

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
instagram-0.8.2 spec/instagram/client_spec.rb
instagram-fixed-0.8.1 spec/instagram/client_spec.rb
instagram-fixed-0.8 spec/instagram/client_spec.rb
instagram-innonate-0.8 spec/instagram/client_spec.rb
instagram-0.8 spec/instagram/client_spec.rb
instagram-0.7 spec/instagram/client_spec.rb
instagram-0.6.2 spec/instagram/client_spec.rb
localist-instagvram-0.6.2 spec/instagram/client_spec.rb
instagram-0.6.1 spec/instagram/client_spec.rb
instagram-0.6 spec/instagram/client_spec.rb