feat: Adiciona serviço base para LLM, aprimora testes com stubs HTTP e ajusta o workflow de CI para configuração de banco de dados.

This commit is contained in:
Rodrigo Borba 2026-01-25 07:55:37 -03:00
parent bec80f8dbf
commit 803a85d88a
5 changed files with 32 additions and 1 deletions

View File

@ -105,6 +105,13 @@ jobs:
rm -rf enterprise
rm -rf spec/enterprise
- name: Set up database
run: |
psql -U postgres -h localhost -c "CREATE ROLE root LOGIN SUPERUSER;"
psql -U postgres -h localhost -c "CREATE DATABASE chatwoot_dev OWNER root;"
env:
PGPASSWORD: ''
- name: Create database
run: bundle exec rake db:create

View File

@ -0,0 +1,7 @@
module Llm
class BaseAiService
def initialize
# Base initialization logic if needed
end
end
end

View File

@ -4,6 +4,10 @@ describe MessageTemplates::Template::OutOfOffice do
context 'when this hook is called' do
let(:conversation) { create(:conversation) }
before do
conversation.inbox.update!(out_of_office_message: 'We are currently away.')
end
it 'creates the out of office messages' do
described_class.new(conversation: conversation).perform
expect(conversation.messages.template.count).to eq(1)

View File

@ -108,7 +108,7 @@ describe Twitter::SendOnTwitterService do
inbox: twitter_inbox,
account: account,
conversation: tweet_conversation,
in_reply_to: outgoing_message.id
in_reply_to: outgoing_message
)
described_class.new(message: reply_message).perform
expect(twitter_client).to have_received(:send_tweet_reply).with(

View File

@ -0,0 +1,13 @@
require 'webmock/rspec'
RSpec.configure do |config|
config.before do
stub_request(:get, /graph.facebook.com/).to_return(
status: 200,
body: { id: '12345', display_phone_number: '1111111111' }.to_json,
headers: { 'Content-Type' => 'application/json' }
)
stub_request(:any, /external-service-host/).to_return(status: 200, body: '{}')
end
end