Skip to content

Commit

Permalink
add a test case for the following
Browse files Browse the repository at this point in the history
  • Loading branch information
msasaki666 committed Jun 15, 2023
1 parent f3f4a1e commit eb8fde0
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions spec/activerecord-multi-tenant/multi_tenant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,26 @@ class SampleTenant; end
end

context 'with options' do
it 'return true with valid class_name' do
tenant_name = :tenant
options = {
class_name: 'SampleTenant'
}
expect(MultiTenant.tenant_klass_defined?(tenant_name, options)).to eq(true)
context 'and valid class_name' do
it 'return true' do
tenant_name = :tenant
options = {
class_name: 'SampleTenant'
}
expect(MultiTenant.tenant_klass_defined?(tenant_name, options)).to eq(true)
end

it 'return true when tenant class is nested' do
module SampleModule
class SampleNestedTenant; end
end

tenant_name = :tenant
options = {
class_name: 'SampleModule::SampleNestedTenant'
}
expect(MultiTenant.tenant_klass_defined?(tenant_name, options)).to eq(true)
end
end
end
end
Expand Down

0 comments on commit eb8fde0

Please sign in to comment.