Sha256: 6593e51fe2effcd271eac3647f24b91e4589750302aa6e1f697b1da7e0d656cb

Contents?: true

Size: 551 Bytes

Versions: 5

Compression:

Stored size: 551 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, 'http://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

5 entries across 5 versions & 1 rubygems

Version Path
great_schools-0.2.1 spec/great_schools_spec.rb
great_schools-0.2.0 spec/great_schools_spec.rb
great_schools-0.1.2 spec/great_schools_spec.rb
great_schools-0.1.1 spec/great_schools_spec.rb
great_schools-0.1.0 spec/great_schools_spec.rb