Skip to content

Commit

Permalink
Remove recursive shared examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mnovelo committed Jan 9, 2025
1 parent 70a3bd9 commit 32d4ba4
Show file tree
Hide file tree
Showing 7 changed files with 481 additions and 573 deletions.
6 changes: 5 additions & 1 deletion spec/apartment/adapters/postgresql_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
# spec/apartment/adapters/postgresql_adapter_spec.rb

require 'spec_helper'
require 'shared_examples/schema_adapter_examples'

describe Apartment::Adapters::PostgresqlAdapter, database: :postgresql do
subject(:adapter) { described_class.new(config) }

it_behaves_like 'a basic adapter'

context 'when using schemas with schema.rb' do
before { Apartment.use_schemas = true }

Expand All @@ -19,6 +20,7 @@ def tenant_names
let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.schema_search_path.delete('"') } }

it_behaves_like 'a schema based adapter'
it_behaves_like 'handles concurrent schema operations'
end

context 'when using schemas with SQL dump' do
Expand All @@ -39,6 +41,7 @@ def tenant_names
let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.schema_search_path.delete('"') } }

it_behaves_like 'a schema based adapter'
it_behaves_like 'handles concurrent schema operations'

it 'allows for dashes in the schema name' do
expect { Apartment::Tenant.create('has-dashes') }.not_to(raise_error)
Expand All @@ -56,5 +59,6 @@ def tenant_names
let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.current_database } }

it_behaves_like 'a connection based adapter'
it_behaves_like 'handles concurrent connection operations'
end
end
Loading

0 comments on commit 32d4ba4

Please sign in to comment.