Sha256: a7f62a699efb12d43ab1a9fb4ad32d04f125110cab113300d8652c01f561ff8f

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'

describe Xcal::Parktronic::ApiClient do

  let(:api_http_client){ Xcal::Parktronic::ApiClient.new(endpoint: 'http://api.mock', access_token: 'access_token') }
  let(:api_invalid_client){ Xcal::Parktronic::ApiClient.new(endpoint: 'http://api.mock') }

  context 'events history routes' do

    it 'is not allowed without access_token' do
      expect{ api_invalid_client.get_paged_event_history_items(page: 1, per_page: 5) }.not_to raise_error
    end

    context 'getting' do
      it 'responds with the correct set of events history' do
        event_history_items = api_http_client.get_paged_event_history_items(page: 1, per_page: 5)
        expect(event_history_items.first.event_id.to_s).to eql('1')
        expect(event_history_items.first.event_status).to eql('Resolved')
        expect(event_history_items.first.initiated_at).to eql('2013-12-30T21:03:39.000Z')


        expect(event_history_items.last.event_id.to_s).to eql('2')
        expect(event_history_items.last.event_status).to eql('ACKNOWLEDGED')
        expect(event_history_items.last.initiated_at).to eql('2013-12-26T21:03:39.000Z')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xcal-parktronic-1.3.0 spec/lib/xcal/parktronic/routes/event_history_items_routes_spec.rb
xcal-parktronic-1.2.0 spec/lib/xcal/parktronic/routes/event_history_items_routes_spec.rb