Sha256: a5dc8f7536a91066b55837a489bd664058df2b0813b12aa8da8934a53a59085e

Contents?: true

Size: 1.39 KB

Versions: 4

Compression:

Stored size: 1.39 KB

Contents

require 'helper'

describe WorldbankAsDataframe::Indicator do
  context 'find' do
    it 'returns a WorldbankAsDataframe::Indicator' do
      stub_get('indicators/AG.AGR.TRAC.NO?format=json').
        to_return(:status => 200, :body => fixture('indicators_tractors.json'))
      tractors = WorldbankAsDataframe::Indicator.find('AG.AGR.TRAC.NO').fetch
      a_get('indicators/AG.AGR.TRAC.NO?format=json').should have_been_made
      tractors.should be_a WorldbankAsDataframe::Indicator
    end
    context 'returned Indicator has' do
      before do
        stub_get('indicators/AG.AGR.TRAC.NO?format=json').
          to_return(:status => 200, :body => fixture('indicators_tractors.json'))
        @tractors = WorldbankAsDataframe::Indicator.find('AG.AGR.TRAC.NO').fetch
      end
      it 'an id' do
        @tractors.id.should eql 'AG.AGR.TRAC.NO'
      end
      it 'a name' do
        @tractors.name.should eql 'Agricultural machinery, tractors'
      end
      it 'a source' do
        @tractors.source.should be_a WorldbankAsDataframe::Source
      end
      it 'a note' do
        @tractors.note[0..19].should eql 'Agricultural machine'
      end
      it 'an organization' do
        @tractors.organization.should eql 'Food and Agriculture Organization, electronic files and web site.'
      end
      it 'many topics' do
        @tractors.topics[0].should be_a WorldbankAsDataframe::Topic
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
worldbank_as_dataframe-0.2.1 spec/worldbank_as_dataframe/indicator_spec.rb
worldbank_as_dataframe-0.2 spec/worldbank_as_dataframe/indicator_spec.rb
worldbank_as_dataframe-0.1.1 spec/worldbank_as_dataframe/indicator_spec.rb
worldbank_as_dataframe-0.1.0 spec/worldbank_as_dataframe/indicator_spec.rb