Sha256: 81cd3da83b6b0315251b0096ac86e3432ffaa53573a557505abca66f86782421
Contents?: true
Size: 1.16 KB
Versions: 3
Compression:
Stored size: 1.16 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') module WhosGotDirt::Requests::Relation RSpec.describe OpenOil do describe '#to_s' do it 'should return the URL to request' do expect(OpenOil.new(subject: [name: 'Petrobras']).to_s).to eq('https://api.openoil.net/concession/search?licensee=Petrobras') end end describe '#convert' do context 'when given a name' do include_examples 'equal', 'licensee', 'name', 'Petrobras', scope: 'subject' end context 'when given a limit' do include_examples 'equal', 'per_page', 'limit', 5 end context 'when given an API key' do include_examples 'equal', 'apikey', 'open_oil_api_key', 123 end context 'when given a country' do include_examples 'equal', 'country', 'country_code', 'br', transformed: 'BR' end context 'when given a status' do include_examples 'equal', 'status', 'status', 'licensed', valid: ['licensed', 'unlicensed'] end context 'when given a type' do include_examples 'equal', 'type', 'type', 'offshore', valid: ['offshore', 'onshore'] end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
whos_got_dirt-0.0.4 | spec/requests/relation/open_oil_spec.rb |
whos_got_dirt-0.0.3 | spec/requests/relation/open_oil_spec.rb |
whos_got_dirt-0.0.2 | spec/requests/relation/open_oil_spec.rb |