require 'spec_helper' describe Ratis::Landmark do before do stub_atis_request.to_return( atis_response 'Getlandmarks', '1.4', '0', <<-BODY ) 5007 FALCON FIELD AIRPORT 4800 E. FALCON DR. ME 33.456119 -111.728010 N AIRPT 3 Hours of Operation: 85215 5009 SKY HARBOR AIRPORT TERMINAL 4 WB 3700 E SKY HARBOR BLVD PH 33.434520 -111.996145 N AIRPT 3 Hours of Operation: !!!!!!!!24 hours 99999 BODY @landmarks = Ratis::Landmark.where :type => :all end it 'only makes one request' do an_atis_request.should have_been_made.times 1 end it 'requests the correct SOAP action' do an_atis_request_for('Getlandmarks', 'Type' => 'ALL').should have_been_made end it 'should return all landmarks' do @landmarks.should have(2).items @landmarks[0].type.should eql 'AIRPT' @landmarks[0].verbose.should eql 'FALCON FIELD AIRPORT' @landmarks[0].location.should eql '4800 E. FALCON DR.' @landmarks[0].locality.should eql 'N' @landmarks[1].type.should eql 'AIRPT' @landmarks[1].verbose.should eql 'SKY HARBOR AIRPORT TERMINAL 4 WB' @landmarks[1].location.should eql '3700 E SKY HARBOR BLVD' @landmarks[1].locality.should eql 'N' end end