Sha256: 57dd26c0e1f949bab19ebf177c9251eee0009fbe99856c22a99a707c92cd7d83

Contents?: true

Size: 1.1 KB

Versions: 27

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

27 entries across 27 versions & 1 rubygems

Version Path
auth0-5.6.1 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.6.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.5.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.4.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.3.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.2.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.1.2 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.1.1 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.1.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.0.1 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-5.0.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-4.17.1 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-4.17.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-4.16.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-4.15.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-4.14.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-4.13.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-4.12.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-4.11.0 spec/lib/auth0/api/v2/tenants_spec.rb
auth0-4.10.0 spec/lib/auth0/api/v2/tenants_spec.rb