Sha256: 2d39edb71328000ed04c84f33ae460ffbe2ab55a4e98bc9092c7b86955291a42

Contents?: true

Size: 1.19 KB

Versions: 18

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

describe Ratis::LandmarkCategory do

  before do
    stub_atis_request.to_return( atis_response 'Getcategories', '1.1', '0', <<-BODY )
    <Types>
      <Typeinfo>
        <Type>AIRPORT</Type>
        <Description>AIRPT</Description>
      </Typeinfo>
      <Typeinfo>
        <Type>CASINO</Type>
        <Description>CAS</Description>
      </Typeinfo>
      <Typeinfo>
        <Type>CEMETARIES</Type>
        <Description>CEM</Description>
      </Typeinfo>
    </Types>
    BODY

    @landmark_categories = Ratis::LandmarkCategory.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('Getcategories').should have_been_made
  end

  it 'should return all landmark categories' do
    @landmark_categories.should have(3).items

    @landmark_categories[0].type.should eql 'AIRPORT'
    @landmark_categories[0].description.should eql 'AIRPT'
    @landmark_categories[1].type.should eql 'CASINO'
    @landmark_categories[1].description.should eql 'CAS'
    @landmark_categories[2].type.should eql 'CEMETARIES'
    @landmark_categories[2].description.should eql 'CEM'
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ratis-3.3.6 spec/ratis/landmark_category_spec.rb
ratis-3.3.5 spec/ratis/landmark_category_spec.rb
ratis-3.3.4 spec/ratis/landmark_category_spec.rb
ratis-3.3.3 spec/ratis/landmark_category_spec.rb
ratis-3.3.2 spec/ratis/landmark_category_spec.rb
ratis-3.3.1 spec/ratis/landmark_category_spec.rb
ratis-3.3.0 spec/ratis/landmark_category_spec.rb
ratis-3.2.1 spec/ratis/landmark_category_spec.rb
ratis-3.2.0 spec/ratis/landmark_category_spec.rb
ratis-3.1.8 spec/ratis/landmark_category_spec.rb
ratis-3.1.7 spec/ratis/landmark_category_spec.rb
ratis-3.1.6 spec/ratis/landmark_category_spec.rb
ratis-3.1.5.1 spec/ratis/landmark_category_spec.rb
ratis-3.1.5 spec/ratis/landmark_category_spec.rb
ratis-3.1.4 spec/ratis/landmark_category_spec.rb
ratis-3.1.3 spec/ratis/landmark_category_spec.rb
ratis-3.1.2 spec/ratis/landmark_category_spec.rb
ratis-3.1.1 spec/ratis/landmark_category_spec.rb