Skip to content

Commit

Permalink
✅ Fix leaky spec
Browse files Browse the repository at this point in the history
This commit will return the account back to the default after the
create_account_spec is run to it doesn't interfere with other specs.
  • Loading branch information
kirkkwang committed Jan 15, 2025
1 parent e1c380d commit b060289
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/services/create_account_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
let(:account) { FactoryBot.build(:sign_up_account) }
let(:stubbed_admin_set) { double(AdminSetResource, id: "admin_set/id") }

after do
# Ensure we reset to the default tenant after each test
Apartment::Tenant.switch!(Apartment.default_tenant)
end

describe '#create_tenant' do
it 'creates a new apartment tenant' do
expect(Apartment::Tenant).to receive(:create).with(account.tenant)
Expand Down

0 comments on commit b060289

Please sign in to comment.