Sha256: c672089431d3e9894c70d913a10819bb26fd313d630b2ea97b2bf6f3471c48ca

Contents?: true

Size: 552 Bytes

Versions: 1

Compression:

Stored size: 552 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))

describe GreatSchools::API do
  it 'should raise an error when our key is rejected' do
    xml = File.read(File.expand_path(
      File.join(File.dirname(__FILE__), 'fixtures', 'error.xml')
    ))
    FakeWeb.register_uri(:get, 'https://api.greatschools.org/reviews/city/CA/Foster-City?key=0123456789ABCDEF', body: xml, status: [401, 'Unauthorized'])

    expect {
      GreatSchools::API.get('reviews/city/CA/Foster-City')
    }.to raise_error(GreatSchools::Error)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
great_schools-0.2.3 spec/great_schools_spec.rb