Skip to content

Commit b060289

Browse files
author
Kirk Wang
committed
✅ Fix leaky spec
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.
1 parent e1c380d commit b060289

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/services/create_account_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
let(:account) { FactoryBot.build(:sign_up_account) }
77
let(:stubbed_admin_set) { double(AdminSetResource, id: "admin_set/id") }
88

9+
after do
10+
# Ensure we reset to the default tenant after each test
11+
Apartment::Tenant.switch!(Apartment.default_tenant)
12+
end
13+
914
describe '#create_tenant' do
1015
it 'creates a new apartment tenant' do
1116
expect(Apartment::Tenant).to receive(:create).with(account.tenant)

0 commit comments

Comments
 (0)