Sha256: 3f863f4894135bdb630822d8e83883730bb66252c375696cb108314c8e674ff1

Contents?: true

Size: 1.1 KB

Versions: 13

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'
describe Auth0::Api::V2::Tenants do
  before :all do
    @instance = DummyClass.new.extend(Auth0::Api::V2::Tenants)
  end

  context '.get_tenant_settings' do
    it { expect(@instance).to respond_to(:get_tenant_settings) }
    it 'expect client to send post to /api/v2/tenants/settings with fields' do
      expect(@instance).to receive(:get).with('/api/v2/tenants/settings', { fields: 'field', include_fields: true })
      expect { @instance.get_tenant_settings(fields: 'field') }.not_to raise_error
    end
  end
  context '.update_tenant_settings' do
    it { expect(@instance).to respond_to(:update_tenant_settings) }
    it 'expect client to send post to /api/v2/tenants/settings with body' do
      expect(@instance).to receive(:patch).with('/api/v2/tenants/settings', 'test body')
      expect { @instance.update_tenant_settings('test body') }.not_to raise_error
    end
    it 'expect client to rasie error when calling with empty body' do
      expect { @instance.update_tenant_settings(nil) }.to raise_error(
        'Must supply a valid body to update tenant settings'
      )
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
auth0-5.16.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.15.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.14.2 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.14.1 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.14.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.13.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.12.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.11.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.10.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.9.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.8.1 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.8.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.7.0 spec/lib/auth0/api/v2/tenants_spec.rb