spec/ratis/route_pattern_spec.rb in ratis-3.3.6 vs spec/ratis/route_pattern_spec.rb in ratis-3.3.7

- old
+ new

@@ -7,19 +7,20 @@ config.endpoint = 'http://soap.valleymetro.org/cgi-bin-soap-web-262/soap.cgi' config.namespace = 'PX_WEB' end end - describe '#where' do - + describe '#where', vcr: {} do + # :route_short_name => "LTRL", :direction => "E", :date => "01/01/2014", :service_type => 'W', :routeid => "46880" before do - @today = Chronic.parse('tomorrow at 8am') # Time.now.strftime("%m/%d/%Y") - @conditions = {:route_short_name => '0', - :direction => 'N', + @today = Chronic.parse('today at 12pm') + @conditions = {:route_short_name => 'LTRL', + :direction => 'E', :date => @today, :service_type => 'W', - :routeid => '83720' } + :routeid => '46880' + } end it 'only makes one request' do # false just to stop further processing of response Ratis::Request.should_receive(:get).once.and_call_original @@ -27,15 +28,15 @@ end it 'requests the correct SOAP action' do Ratis::Request.should_receive(:get) do |action, options| action.should eq('Routepattern') - options["Route"].should eq('0') - options["Direction"].should eq('N') + options["Route"].should eq('LTRL') + options["Direction"].should eq('E') options["Date"].should eq(@today) options["Servicetype"].should eq('W') - options["Routeid"].should eq('83720') + options["Routeid"].should eq('46880') end.and_return(double('response', :success? => false)) Ratis::RoutePattern.all(@conditions.dup) end @@ -58,16 +59,16 @@ it 'should parse the stop fields' do routepattern = Ratis::RoutePattern.all(@conditions.dup) stop = routepattern.stops.first - expect(stop.desc).to eq('CENTRAL AVE & DOBBINS RD') + expect(stop.desc).to eq('MONTEBELLO/19TH AVE LIGHT RAIL STATION') expect(stop.area).to eq('Phoenix') - expect(stop.atisid).to eq('3317') - expect(stop.stopid).to eq('10050') - expect(stop.point).to eq("33.36369,-112.07319") - expect(stop.lat).to eq('33.36369') - expect(stop.lng).to eq('-112.07319') + expect(stop.atisid).to eq('10869') + expect(stop.stopid).to eq('10001') + expect(stop.point).to eq("33.52120,-112.09975") + expect(stop.lat).to eq('33.52120') + expect(stop.lng).to eq('-112.09975') expect(stop.boardflag).to eq('E') expect(stop.timepoint).to eq('Y') end it "should raise error for missing arg route_short_name" do