Sha256: 76b51266c2983ca2de52d2704d57929ebcf0414afdebc81d88945124b98178bb

Contents?: true

Size: 538 Bytes

Versions: 4

Compression:

Stored size: 538 Bytes

Contents

require 'spec_helper'

describe Buffer::Client do
  describe "#link" do
    let(:client) { Buffer::Client.new("some_token") }
    let(:url) { %q{http://bufferapp.com} }

    before do
      stub_request(:get, "#{ base_path }/links/shares.json?#{ access_token_param }&url=http://bufferapp.com").
      to_return(fixture('link.txt'))
    end

    it "connects to the correct endpoint" do
      client.link({url: url})
    end

    it "parses the shares of a link" do
      client.link({url: url}).shares.should eq(47348)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
buffer-0.1.3 spec/lib/buffer/link_spec.rb
buffer-0.1.2 spec/lib/buffer/link_spec.rb
buffer-0.1.1 spec/lib/buffer/link_spec.rb
buffer-0.1.0 spec/lib/buffer/link_spec.rb