Sha256: 24cde35d0d8a3dd7f9243f7cd7b8a72fddb93b9130417f0f90d61ee1e70a4bb7

Contents?: true

Size: 771 Bytes

Versions: 1

Compression:

Stored size: 771 Bytes

Contents

require "spec_helper"

describe IdbusApi::Endpoint::Stops do

  before do
    IdbusApi.reset!
  end

  context "Not authenticated", :vcr do
    describe ".stops" do
      it "raises an unauthorized execption" do
        expect {
          IdbusApi.client.stops
        }.to raise_error(Api::Unauthorized)
      end
    end
  end

  context "authenticated", :vcr do
    describe ".stops" do
      it "returns a list of stops" do
        client = token_client
        stops = client.stops

        expect(stops).to be_an(Array)
        expect(stops.count).to be(23)
        expect(stops.first).to be_a(Sawyer::Resource)

        stop = stops.first
        expect(stop.id).to be(2)
        expect(stop.short_name).to eql("Paris CDG (aƩroport)")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
idbus_api-0.0.1 spec/idbus_api/endpoint/stops_spec.rb