Skip to content

Instantly share code, notes, and snippets.

@cheesepaulo
Created May 16, 2017 15:01
Show Gist options
  • Save cheesepaulo/4f2b53afb1aa2988e7a7f056567b987e to your computer and use it in GitHub Desktop.
Save cheesepaulo/4f2b53afb1aa2988e7a7f056567b987e to your computer and use it in GitHub Desktop.
require 'rails_helper'
require 'sptrans/sptrans_api_service'
describe SPTrans::APIService do
describe "#connect" do
subject { described_class.new.connect(HTTPClient.new).status_code }
it { is_expected.to eq 200 }
end
describe '#getUpcomingBus' do
it "returns a hash with data" do
response = described_class.new.getUpcomingBus("4200953")
expect(response.class).to eq Hash
expect(response).to_not be_empty
end
end
describe '#getBusPosition' do
it "returns a hash with data" do
response = described_class.new.getBusPosition("175T-10")
expect(response.class).to eq Hash
expect(response).to_not be_empty
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment