# encoding: utf-8 require 'spec_helper' describe BikePOA::MapParser do include FixtureHelper context 'given a full map page' do let(:map_page) { fixture('full_page.html').unpack('C*').pack('U*') } # gambi pattern around encoding silliness let(:result) { subject.parse(map_page) } it 'extracts relevant lines out of a map page' do result.should have(40).stations end %w[id name address online status size available].each do |field| it "extracted data for #{field} in all entries" do result.map { |h| h.has_key? field }.should == [true] * 40 end end end context 'given a certain area of a map page' do let(:content) { <