Sha256: 6ef9efd799d483592fa9a03eaec50e6c2a9d99f99ffe0a18d03fbb1049afa3e3

Contents?: true

Size: 1.8 KB

Versions: 6

Compression:

Stored size: 1.8 KB

Contents

require 'spec_helper'

describe TMS::IpawsNwemAreas do

  it 'gets IPAWS NWEM areas from client' do
    client = double(:client)
    response_body = [
      {
        "countyFipsCd"=>"51013",
        "countyName"=>"Arlington",
        "geoType"=>"C",
        "stateCd"=>"VA",
        "stateFips"=>"51",
        "stateName"=>"Virginia",
        "zoneCd"=>"054",
        "zoneName"=>"Arlington/Falls Church/Alexandria"
      },
      {
        "countyFipsCd"=>"51510",
        "countyName"=>"City of Alexandria",
        "geoType"=>"C",
        "stateCd"=>"VA",
        "stateFips"=>"51",
        "stateName"=>"Virginia",
        "zoneCd"=>"054",
        "zoneName"=>"Arlington/Falls Church/Alexandria"
      }
    ]
    nwem_areas = TMS::IpawsNwemAreas.new(client, '/ipaws/nwem_areas')

    nwem_areas.client.should_receive('get').with(nwem_areas.href).and_return(
      double('response', :status => 200, :body => response_body, :headers => {})
    )
    nwem_areas.get.should == nwem_areas
    nwem_areas.collection.size.should == 2

    nwem_area = nwem_areas.collection[0]
    nwem_area.countyFipsCd.should == '51013'
    nwem_area.countyName.should == 'Arlington'
    nwem_area.geoType.should == 'C'
    nwem_area.stateCd.should == 'VA'
    nwem_area.stateFips.should == '51'
    nwem_area.stateName.should == 'Virginia'
    nwem_area.zoneCd.should == '054'
    nwem_area.zoneName.should == 'Arlington/Falls Church/Alexandria'

    nwem_area = nwem_areas.collection[1]
    nwem_area.countyFipsCd.should == '51510'
    nwem_area.countyName.should == 'City of Alexandria'
    nwem_area.geoType.should == 'C'
    nwem_area.stateCd.should == 'VA'
    nwem_area.stateFips.should == '51'
    nwem_area.stateName.should == 'Virginia'
    nwem_area.zoneCd.should == '054'
    nwem_area.zoneName.should == 'Arlington/Falls Church/Alexandria'
  end

end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
govdelivery-tms-0.8.0 spec/ipaws_nwem_areas_spec.rb
tms_client-0.6.0 spec/ipaws_nwem_areas_spec.rb
tms_client-0.5.4 spec/ipaws_nwem_areas_spec.rb
tms_client-0.5.3 spec/ipaws_nwem_areas_spec.rb
tms_client-0.5.2 spec/ipaws_nwem_areas_spec.rb
tms_client-0.5.1 spec/ipaws_nwem_areas_spec.rb