Sha256: ab1d827be5654ef3a77132b1c88122d8983f4c22ccb26b97678ef7ef86a1d8bf

Contents?: true

Size: 1.06 KB

Versions: 5

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'
describe ProductSpy, 'ebay' do
  context 'parse url' do
    it 'parses: http://www.ebay.de/itm/390542152250' do
      host, pk = ProductSpy.parse('http://www.ebay.de/itm/390542152250')
      host.should == 'www.ebay.de'
      pk.should == ['390542152250']
    end

    it 'parses: https://www.ebay.de/itm/390542152250' do
      host, pk = ProductSpy.parse('https://www.ebay.de/itm/390542152250')
      host.should == 'www.ebay.de'
      pk.should == ['390542152250']
    end

    it 'parses: http://www.ebay.de/itm/Inspirierende-Ferienhauser-/390542152250?pt=Sach_Fachb%C3%BCcher&hash=item5aee20523a#ht_500wt_948' do
      host, pk = ProductSpy.parse('http://www.ebay.de/itm/Inspirierende-Ferienhauser-/390542152250?pt=Sach_Fachb%C3%BCcher&hash=item5aee20523a#ht_500wt_948')
      host.should == 'www.ebay.de'
      pk.should == ['390542152250']
    end
  end

  context 'build url' do
    it 'returns: https://www.ebay.de/itm/390542152250' do
      ProductSpy.build('www.ebay.de', ['390542152250']).should == 'https://www.ebay.de/itm/390542152250'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
product_spy-0.0.6 spec/ebay_spec.rb
product_spy-0.0.5 spec/ebay_spec.rb
product_spy-0.0.4 spec/ebay_spec.rb
product_spy-0.0.3 spec/ebay_spec.rb
product_spy-0.0.2 spec/ebay_spec.rb