Sha256: 858352596161e6fef4c40b22c14f93dc75b0cb7c44b687ecf014cb85b3123f46

Contents?: true

Size: 576 Bytes

Versions: 1

Compression:

Stored size: 576 Bytes

Contents

require 'spec_helper'

describe Popularity::Pinterest do
  context "valid url" do
    use_vcr_cassette "pinterest"

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

    it "should return correct pin count" do
      expect(11278).to eq subject.pins
    end

    it "should calculate the correct total" do
      expect(subject.total).to eq subject.pins
    end

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
popularity-0.2.1 spec/pinterest_spec.rb