Sha256: 878c2ffadaf8fbc2973d818ed297526b8291678d82787dcc4bfc7ed13d808d53

Contents?: true

Size: 1.14 KB

Versions: 27

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'
require 'td/client/spec_resources'
require 'json'

describe 'Access Control API' do
  include_context 'spec symbols'
  include_context 'common helper'

  let :api do
    # no retry for GET
    API.new(nil, {:max_cumul_retry_delay => -1})
  end

  describe 'all apis' do
    it 'is deprecated' do
      stub_api_request(:post, "/v3/acl/grant").to_return(:status => 500)
      expect {
        api.grant_access_control('subject', 'action', 'scope', [])
      }.to raise_error(TreasureData::APIError)

      stub_api_request(:post, "/v3/acl/revoke").to_return(:status => 500)
      expect {
        api.revoke_access_control('subject', 'action', 'scope')
      }.to raise_error(TreasureData::APIError)

      stub_api_request(:get, "/v3/acl/test", :query => {'user' => 'user', 'action' => 'action', 'scope' => 'scope'}).to_return(:status => 422)
      expect {
        api.test_access_control('user', 'action', 'scope')
      }.to raise_error(TreasureData::APIError)

      stub_api_request(:get, "/v3/acl/list").to_return(:status => 500)
      expect {
        api.list_access_controls
      }.to raise_error(TreasureData::APIError)
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
td-client-1.0.5 spec/td/client/access_control_api_spec.rb
td-client-1.0.4 spec/td/client/access_control_api_spec.rb
td-client-1.0.3 spec/td/client/access_control_api_spec.rb
td-client-1.0.2 spec/td/client/access_control_api_spec.rb
td-client-1.0.1 spec/td/client/access_control_api_spec.rb
td-client-1.0.0-java spec/td/client/access_control_api_spec.rb
td-client-1.0.0 spec/td/client/access_control_api_spec.rb
td-client-0.8.85 spec/td/client/access_control_api_spec.rb
td-client-0.8.84 spec/td/client/access_control_api_spec.rb
td-client-0.8.83 spec/td/client/access_control_api_spec.rb
td-client-0.8.82 spec/td/client/access_control_api_spec.rb
td-client-0.8.81 spec/td/client/access_control_api_spec.rb
td-client-0.8.80 spec/td/client/access_control_api_spec.rb
td-client-0.8.79 spec/td/client/access_control_api_spec.rb
td-client-0.8.78 spec/td/client/access_control_api_spec.rb
td-client-0.9.0dev2 spec/td/client/access_control_api_spec.rb
td-client-0.9.0dev1 spec/td/client/access_control_api_spec.rb
td-client-0.8.77 spec/td/client/access_control_api_spec.rb
td-client-0.8.76 spec/td/client/access_control_api_spec.rb
td-client-0.8.75 spec/td/client/access_control_api_spec.rb