Module: Tenantify::TestHelpers

Defined in:
lib/tenantify/test_helpers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.clear_tenantObject



21
22
23
24
# File 'lib/tenantify/test_helpers.rb', line 21

def self.clear_tenant
  Tenantify.current_tenant = nil
  Tenantify::Current.reset
end

.set_tenant(tenant) ⇒ Object



17
18
19
# File 'lib/tenantify/test_helpers.rb', line 17

def self.set_tenant(tenant)
  Tenantify.current_tenant = tenant
end

Instance Method Details

#with_tenant(tenant) ⇒ Object



5
6
7
8
9
# File 'lib/tenantify/test_helpers.rb', line 5

def with_tenant(tenant)
  Tenantify.switch_to(tenant) do
    yield
  end
end

#without_tenantObject



11
12
13
14
15
# File 'lib/tenantify/test_helpers.rb', line 11

def without_tenant
  Tenantify.without_tenant do
    yield
  end
end