Sha256: 89115609efd19b605c7512f2e724074a22238005a45e17cfd3a83e7a605bffe3

Contents?: true

Size: 705 Bytes

Versions: 6

Compression:

Stored size: 705 Bytes

Contents

require 'helper'

# API Key Tests
class Fastly
  describe 'ApiKeyTest' do
    let(:opts)             { login_opts(:api_key) }
    let(:client)           { Client.new(opts) }
    let(:fastly)           { Fastly.new(opts) }

    describe '#current_{user,customer}' do
      it 'should not have access to current user 'do
        assert_raises(Error) do
          client.get('/current_user')
        end

        assert_raises(FullAuthRequired) do
          fastly.current_user
        end
      end

      it 'should have access to current customer' do
        assert_instance_of Hash, client.get('/current_customer')
        assert_instance_of Customer, fastly.current_customer
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fastly-1.3.0 test/api_key_test.rb
fastly-1.2.3 test/api_key_test.rb
fastly-1.2.2 test/api_key_test.rb
fastly-1.2.1 test/api_key_test.rb
fastly-1.2.0 test/api_key_test.rb
fastly-1.1.5 test/api_key_test.rb