Sha256: 882505a571dd09f606fdcf3359565f4ac970da09d3c4b891b550ff3e0ed8628f

Contents?: true

Size: 1000 Bytes

Versions: 5

Compression:

Stored size: 1000 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
    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

5 entries across 5 versions & 2 rubygems

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