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:
@@ -44,6 +44,8 @@ RSpec.describe Integrations::Openai::ProcessorService do
|
|||||||
|
|
||||||
create(:label, account: account)
|
create(:label, account: account)
|
||||||
create(:label, account: account)
|
create(:label, account: account)
|
||||||
|
|
||||||
|
hook.settings['label_suggestion'] = 'true'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns the label suggestions' do
|
it 'returns the label suggestions' do
|
||||||
@@ -81,5 +83,26 @@ RSpec.describe Integrations::Openai::ProcessorService do
|
|||||||
expect(subject.perform).to be_nil
|
expect(subject.perform).to be_nil
|
||||||
end
|
end
|
||||||
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
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user