From 9018ec9678fdd15f4d30a9a04d9e94633bf7d452 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 17 Oct 2023 18:06:54 +0530 Subject: [PATCH] test: reset `Current.user` after spec (#8123) --- spec/models/conversation_spec.rb | 5 +++++ spec/models/macro_spec.rb | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/spec/models/conversation_spec.rb b/spec/models/conversation_spec.rb index a7bc919b3..70d33b71c 100644 --- a/spec/models/conversation_spec.rb +++ b/spec/models/conversation_spec.rb @@ -5,6 +5,11 @@ require Rails.root.join 'spec/models/concerns/assignment_handler_shared.rb' require Rails.root.join 'spec/models/concerns/auto_assignment_handler_shared.rb' RSpec.describe Conversation do + after do + Current.user = nil + Current.account = nil + end + describe 'associations' do it { is_expected.to belong_to(:account) } it { is_expected.to belong_to(:inbox) } diff --git a/spec/models/macro_spec.rb b/spec/models/macro_spec.rb index 4df74b7fa..1b7161476 100644 --- a/spec/models/macro_spec.rb +++ b/spec/models/macro_spec.rb @@ -4,6 +4,11 @@ RSpec.describe Macro do let(:account) { create(:account) } let(:admin) { create(:user, account: account, role: :administrator) } + after do + Current.user = nil + Current.account = nil + end + describe 'associations' do it { is_expected.to belong_to(:account) } end