Sha256: 57c3512d1dacd837ed8fe4a50af7a4068d04233f7a6de618b5c2bde66d5b9cdf

Contents?: true

Size: 611 Bytes

Versions: 3

Compression:

Stored size: 611 Bytes

Contents

require 'spec_helper'

describe Popularity::GooglePlus do
  context "valid url" do
    use_vcr_cassette "google_plus"

    subject {
      Popularity::GooglePlus.new('http://google.com')
    }

    it "should return correct plus-one count" do
      expect(11180649).to eq subject.plus_ones
    end

    it "should calculate the correct total" do
      expect(subject.plus_ones).to equal subject.total
    end

    context "json" do
      let(:json) { subject.to_json }

      it "should have required attributes in json" do 
        expect(subject.plus_ones).to eq(json["plus_ones"])
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
popularity-0.1.1 spec/google_plus_spec.rb
popularity-0.1.0 spec/google_plus_spec.rb
popularity-0.0.1 spec/google_plus_spec.rb