Sha256: d18a7502f03810b212eb9813c6776a4ac8f58e1d8270fa671496758909bdba77

Contents?: true

Size: 549 Bytes

Versions: 1

Compression:

Stored size: 549 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, "https://api.bufferapp.com/1/links/shares.json?access_token=some_token&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

1 entries across 1 versions & 1 rubygems

Version Path
buff-0.0.1 spec/lib/buff/link_spec.rb