Sha256: ac0e9be89303ef99fe78419cd2e779d21bd66e94fde3e410e67bab13c389ce5f

Contents?: true

Size: 878 Bytes

Versions: 1

Compression:

Stored size: 878 Bytes

Contents

require 'helper'

describe WorldBank::Topic do

  context 'find' do

    it 'returns an instance of Topic' do
      stub_get('topics/6?format=json').
        to_return(:status => 200, :body => fixture('topic_6.json'))
      @environment = WorldBank::Topic.find(6).fetch
      a_get('topics/6?format=json').should have_been_made
      @environment.should be_a WorldBank::Topic
    end

    context 'returned topic has' do

      before do
        stub_get('topics/6?format=json').
          to_return(:status => 200, :body => fixture('topic_6.json'))
        @environment = WorldBank::Topic.find(6).fetch
      end
      it 'name' do
        @environment.name.should eql 'Environment '
      end

      it 'id' do
        @environment.id.should eql '6'
      end

      it 'note' do
        @environment.note[0..20].should eql "Natural and man-made "
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
world_bank-0.9.0 spec/world_bank/topic_spec.rb