Sha256: 17d23e69f971938721711df987a48c0eba9219a03e9ad31136128d23778a7a6e

Contents?: true

Size: 534 Bytes

Versions: 5

Compression:

Stored size: 534 Bytes

Contents

require 'spec_helper'

describe Buff::Client do
  describe "#link" do
    let(:client) { Buff::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

5 entries across 5 versions & 1 rubygems

Version Path
buff-0.0.6 spec/lib/buff/link_spec.rb
buff-0.0.5 spec/lib/buff/link_spec.rb
buff-0.0.4 spec/lib/buff/link_spec.rb
buff-0.0.3 spec/lib/buff/link_spec.rb
buff-0.0.2 spec/lib/buff/link_spec.rb