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:
parent
bec80f8dbf
commit
803a85d88a
7
.github/workflows/run_foss_spec.yml
vendored
7
.github/workflows/run_foss_spec.yml
vendored
@ -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
|
||||
|
||||
|
||||
7
app/services/llm/base_ai_service.rb
Normal file
7
app/services/llm/base_ai_service.rb
Normal file
@ -0,0 +1,7 @@
|
||||
module Llm
|
||||
class BaseAiService
|
||||
def initialize
|
||||
# Base initialization logic if needed
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -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)
|
||||
|
||||
@ -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(
|
||||
|
||||
13
spec/support/http_stubs.rb
Normal file
13
spec/support/http_stubs.rb
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user