Sha256: 2278240dfa49d81f4e00571e21569486d546b2bde5dd212b815f6bca41e5b81d

Contents?: true

Size: 776 Bytes

Versions: 4

Compression:

Stored size: 776 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

module WhosGotDirt::Responses::List
  RSpec.describe OpenCorporates, vcr: {cassette_name: 'open_corporates_list'} do
    let :response do
      Faraday.get('https://api.opencorporates.com/corporate_groupings/search')
    end

    let :instance do
      OpenCorporates.new(response)
    end

    describe '#to_a' do
      it 'should return the results' do
        expect{instance.to_a}.to_not raise_error
      end
    end

    describe '#count' do
      it 'should return the number of results' do
        expect(instance.count).to be > 800
      end
    end

    describe '#page' do
      it 'should return the current page number' do
        expect(instance.page).to eq(1)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
whos_got_dirt-0.0.5 spec/responses/list/open_corporates_spec.rb
whos_got_dirt-0.0.4 spec/responses/list/open_corporates_spec.rb
whos_got_dirt-0.0.3 spec/responses/list/open_corporates_spec.rb
whos_got_dirt-0.0.2 spec/responses/list/open_corporates_spec.rb