Sha256: 42de78397c1b88dfdd4e19e74225295db8756acfb1870471edc15f500b51ff93

Contents?: true

Size: 729 Bytes

Versions: 1

Compression:

Stored size: 729 Bytes

Contents

require 'spec_helper'

describe JohnStamos::ExtractionHelper, :vcr do

  let(:pin_page_content) do
    page_with_embedded_json = 'http://www.pinterest.com/pin/412149803369441273'

    client = JohnStamos::Client.new
    client.page_content(page_with_embedded_json)
  end

  describe '.embedded_page_json' do
    it 'returns a hash' do
      described_class.embedded_page_json(pin_page_content).should be_a(Hash)
    end

    it 'returns the extracted JSON Pinterest uses to start the client side backbone app' do
      # the 'tree' key is commonly used to store page data
      # if we have this key, we have the right json blob
      described_class.embedded_page_json(pin_page_content).should have_key('tree')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
john_stamos-0.0.3 spec/lib/john_stamos/extraction_helper_spec.rb