test: reset Current.user after spec (#8123)

This commit is contained in:
Shivam Mishra
2023-10-17 18:06:54 +05:30
committed by GitHub
parent e55fe33f1b
commit 9018ec9678
2 changed files with 10 additions and 0 deletions

View File

@@ -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' require Rails.root.join 'spec/models/concerns/auto_assignment_handler_shared.rb'
RSpec.describe Conversation do RSpec.describe Conversation do
after do
Current.user = nil
Current.account = nil
end
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:account) } it { is_expected.to belong_to(:account) }
it { is_expected.to belong_to(:inbox) } it { is_expected.to belong_to(:inbox) }

View File

@@ -4,6 +4,11 @@ RSpec.describe Macro do
let(:account) { create(:account) } let(:account) { create(:account) }
let(:admin) { create(:user, account: account, role: :administrator) } let(:admin) { create(:user, account: account, role: :administrator) }
after do
Current.user = nil
Current.account = nil
end
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:account) } it { is_expected.to belong_to(:account) }
end end