Sha256: f3f6709153d9e0c2dca0c1ad7668d1be99d454f81d712d6a855a0e4073d916e8

Contents?: true

Size: 902 Bytes

Versions: 5

Compression:

Stored size: 902 Bytes

Contents

require 'spec_helper'
require 'helpers/sample_crawler'

describe SampleCrawler do
  before(:each) do
    @sample_crawler = SampleCrawler.new
  end

  it 'should correctly assign event metadata' do
    @sample_crawler.should_receive(:parse) do |args|
      args['event_group'].wombat_property_selector.should == "css=div.title-agenda"
      it = args['event_group']
      expect(it["event"]["title"].wombat_property_selector).to eq("xpath=.")
      expect(it["event"]["date"].wombat_property_selector).to(
        eq("xpath=//div[@class='scrollable-items']/div[@class='s-item active']//a"))
      expect(it["event"]["type"].wombat_property_selector).to eq("xpath=.type")
      expect(it["venue"]["name"].wombat_property_selector).to eq("xpath=.")

      args[:base_url].should == 'http://www.obaoba.com.br'
      args[:path].should == '/porto-alegre/agenda'
    end

    @sample_crawler.crawl
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wombat-2.9.0 spec/sample_crawler_spec.rb
wombat-2.8.0 spec/sample_crawler_spec.rb
wombat-2.7.0 spec/sample_crawler_spec.rb
wombat-2.6.0 spec/sample_crawler_spec.rb
wombat-2.5.1 spec/sample_crawler_spec.rb