feat: Sentiment Analysis (#7475)

This commit is contained in:
Tejaswini Chile
2023-07-12 15:03:31 +05:30
committed by GitHub
parent 550bea099c
commit 10dd0ba647
13 changed files with 256 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
# frozen_string_literal: true
require 'rails_helper'
require Rails.root.join 'spec/models/concerns/liquidable_shared.rb'
RSpec.describe Message do
context 'with sentiment analysis' do
let(:message) { build(:message, message_type: :incoming, content_type: nil, account: create(:account)) }
it 'calls SentimentAnalysisJob' do
allow(Enterprise::SentimentAnalysisJob).to receive(:perform_later).and_return(:perform_later).with(message)
message.save!
expect(Enterprise::SentimentAnalysisJob).to have_received(:perform_later)
end
end
end