Sha256: 7b4d44bc94df4d1d9537e77072c2db80fc9bf288a0296d836be57c61e844573c

Contents?: true

Size: 986 Bytes

Versions: 17

Compression:

Stored size: 986 Bytes

Contents

require 'test_helper'

class GeoCerts::APITest < Test::Unit::TestCase
  
  context 'GeoCerts::API' do
    
    should 'be unauthorized' do
      managed_server_request :get, '/orders.xml', :response => Responses::Unauthorized do
        assert_responds_with_exception(GeoCerts::Unauthorized) do
          GeoCerts::Order.all
        end
      end
    end
    
    should 'raise a GeoCerts::RequestTimeout error when the connection times out' do
      exclusively_mocked_request :get, '/orders.xml', :exception => Timeout::Error do
        assert_responds_with_exception(GeoCerts::RequestTimeout) do
          GeoCerts::Order.all
        end
      end
    end
    
    should 'raise a GeoCerts::RequestTimeout error when the connection gets reset' do
      exclusively_mocked_request :get, '/orders.xml', :exception => Errno::ECONNRESET do
        assert_responds_with_exception(GeoCerts::ConnectionError) do
          GeoCerts::Order.all
        end
      end
    end
    
  end
  
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
geocerts-1.0.1 test/integrations/api_test.rb
geocerts-1.0.0 test/integrations/api_test.rb
geocerts-0.0.25 test/integrations/api_test.rb
geocerts-0.0.24 test/integrations/api_test.rb
geocerts-0.0.23 test/integrations/api_test.rb
geocerts-0.0.22 test/integrations/api_test.rb
geocerts-0.0.21 test/integrations/api_test.rb
geocerts-0.0.20 test/integrations/api_test.rb
geocerts-0.0.19 test/integrations/api_test.rb
geocerts-0.0.18 test/integrations/api_test.rb
geocerts-0.0.17 test/integrations/api_test.rb
geocerts-0.0.16 test/integrations/api_test.rb
geocerts-0.0.15 test/integrations/api_test.rb
geocerts-0.0.14 test/integrations/api_test.rb
geocerts-0.0.13 test/integrations/api_test.rb
geocerts-0.0.12 test/integrations/api_test.rb
geocerts-0.0.11 test/integrations/api_test.rb