chore: Move EE OpenAI spec to correct folder (#8805)

- We previously had this spec inside the enterprise folder which wouldn't be picked up by our build process, so moving to the correct folder instead.

Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
Sojan Jose
2024-01-29 20:09:17 +04:00
committed by GitHub
parent 2eeec22868
commit 648c4caca1

View File

@@ -44,6 +44,8 @@ RSpec.describe Integrations::Openai::ProcessorService do
create(:label, account: account)
create(:label, account: account)
hook.settings['label_suggestion'] = 'true'
end
it 'returns the label suggestions' do
@@ -81,5 +83,26 @@ RSpec.describe Integrations::Openai::ProcessorService do
expect(subject.perform).to be_nil
end
end
context 'when hook is not enabled' do
let(:event) { { 'name' => 'label_suggestion', 'data' => { 'conversation_display_id' => conversation.display_id } } }
before do
create(:message, account: account, conversation: conversation, message_type: :incoming, content: 'hello agent')
create(:message, account: account, conversation: conversation, message_type: :outgoing, content: 'hello customer')
create(:message, account: account, conversation: conversation, message_type: :incoming, content: 'hello agent 2')
create(:message, account: account, conversation: conversation, message_type: :incoming, content: 'hello agent 3')
create(:message, account: account, conversation: conversation, message_type: :incoming, content: 'hello agent 4')
create(:label, account: account)
create(:label, account: account)
hook.settings['label_suggestion'] = nil
end
it 'returns nil' do
expect(subject.perform).to be_nil
end
end
end
end