spec/ratis/location_spec.rb in ratis-3.6.4 vs spec/ratis/location_spec.rb in ratis-3.6.5
- old
+ new
@@ -1,10 +1,11 @@
require 'spec_helper'
describe Ratis::Location do
+ let(:conditions) { { :location => '1315 W. Straford Dr.', :media => 'W' } }
+
describe '#where', vcr: {} do
- let(:conditions) { { :location => '1315 W. Straford Dr.', :media => 'W' } }
it 'only makes one request' do
# false just to stop further processing of response
Ratis::Request.should_receive(:get).once.and_call_original
Ratis::Location.where(conditions.dup)
@@ -53,25 +54,16 @@
pending
@first_location.to_a.should eql ['33.5811205', '-112.2989325', 'W PENNSYLVANIA AVE', '0']
end
end
- describe '#to_hash' do
- it 'returns a subset of Location params' do
- pending
- hash = {
- :latitude => '33.5811205',
- :longitude => '-112.2989325',
- :name => 'W PENNSYLVANIA AVE',
- :area => 'Youngtown',
- :address => '',
- :startaddr => '11105',
- :endaddr => '11111',
- :address_string => '11105 - 11111 W PENNSYLVANIA AVE (in Youngtown)',
- :landmark_id => '0' }
+ describe '#to_hash', vcr: {} do
+ it 'returns all params' do
+ params = [:name, :area, :areacode, :region, :zipname, :latitude, :longitude, :address, :address_string, :landmark_id, :responsecode, :startaddr, :endaddr, :startlatitude, :startlongitude, :endlatitude, :endlongitude]
+ locations = Ratis::Location.where(conditions.dup)
- HashDiff.diff(@first_location.to_hash, hash).should eql []
+ expect(locations.first.to_hash.keys.to_set).to eql params.to_set
end
end
describe '#address_string' do
@@ -83,6 +75,6 @@
describe '#full_address' do
it "does something" do
pending
end
end
-end
\ No newline at end of file
+end