Sha256: 3ffa008a87cafad179392ba8f1654925336b4040e9db5a4eafbeb4060db78b91

Contents?: true

Size: 926 Bytes

Versions: 4

Compression:

Stored size: 926 Bytes

Contents

require 'helper'

describe WorldbankAsDataframe::Region do
  context 'find' do
    it 'returns WorldbankAsDataframe::Region' do
      stub_get('regions/wld?format=json').
        to_return(:status => 200, :body => fixture('regions_world.json'))
      @so_helpful = WorldbankAsDataframe::Region.find('wld').fetch
      a_get('regions/wld?format=json').should have_been_made
      @so_helpful.should be_a WorldbankAsDataframe::Region
    end
    context 'returned Region has' do
      before do
        stub_get('regions/wld?format=json').
          to_return(:status => 200, :body => fixture('regions_world.json'))
        @so_helpful = WorldbankAsDataframe::Region.find('wld').fetch
      end
      it 'an id' do
        @so_helpful.id.should eql ''
      end
      it 'a code' do
        @so_helpful.code.should eql 'WLD'
      end
      it 'a name' do
        @so_helpful.name.should eql 'World'
      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/region_spec.rb
worldbank_as_dataframe-0.2 spec/worldbank_as_dataframe/region_spec.rb
worldbank_as_dataframe-0.1.1 spec/worldbank_as_dataframe/region_spec.rb
worldbank_as_dataframe-0.1.0 spec/worldbank_as_dataframe/region_spec.rb