chore: fix specs
This commit is contained in:
parent
3dac404a19
commit
f32f1d22a3
1 changed files with 7 additions and 1 deletions
|
@ -5,6 +5,7 @@ require Rails.root.join 'spec/models/concerns/assignment_handler_shared.rb'
|
|||
require Rails.root.join 'spec/models/concerns/round_robin_handler_shared.rb'
|
||||
|
||||
RSpec.describe Conversation, type: :model do
|
||||
|
||||
describe 'associations' do
|
||||
it { is_expected.to belong_to(:account) }
|
||||
it { is_expected.to belong_to(:inbox) }
|
||||
|
@ -581,12 +582,17 @@ RSpec.describe Conversation, type: :model do
|
|||
end
|
||||
|
||||
describe '#delete conversation' do
|
||||
include ActiveJob::TestHelper
|
||||
|
||||
let!(:conversation) { create(:conversation) }
|
||||
|
||||
let!(:notification) { create(:notification, notification_type: 'conversation_creation', primary_actor: conversation) }
|
||||
|
||||
it 'delete associated notifications if conversation is deleted' do
|
||||
conversation.destroy!
|
||||
perform_enqueued_jobs do
|
||||
conversation.destroy!
|
||||
end
|
||||
|
||||
expect { notification.reload }.to raise_error ActiveRecord::RecordNotFound
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue