From 2f1d13a6e42877350e3d86f2efc77f3b3c628342 Mon Sep 17 00:00:00 2001 From: Kirk Wang Date: Wed, 15 Jan 2025 14:47:02 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Fix=20leaky=20spec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- spec/services/create_account_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/services/create_account_spec.rb b/spec/services/create_account_spec.rb index d5562384c..70ba896ff 100644 --- a/spec/services/create_account_spec.rb +++ b/spec/services/create_account_spec.rb @@ -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)