style: fix rubocop issues
This commit is contained in:
@@ -8,7 +8,7 @@ RSpec.describe Captain::Conversation::ResponseBuilderJob, type: :job do
|
||||
|
||||
describe '#perform' do
|
||||
let(:conversation) { create(:conversation, inbox: inbox, account: account) }
|
||||
let(:mock_llm_chat_service) { instance_double('Captain::Llm::AssistantChatService') }
|
||||
let(:mock_llm_chat_service) { instance_double(Captain::Llm::AssistantChatService) }
|
||||
|
||||
before do
|
||||
create(:message, conversation: conversation, content: 'Hello', message_type: :incoming)
|
||||
@@ -19,7 +19,7 @@ RSpec.describe Captain::Conversation::ResponseBuilderJob, type: :job do
|
||||
end
|
||||
|
||||
it 'generates and processes response' do
|
||||
expect { described_class.perform_now(conversation, assistant) }.to change { conversation.messages.count }
|
||||
described_class.perform_now(conversation, assistant)
|
||||
expect(conversation.messages.count).to eq(2)
|
||||
expect(conversation.messages.outgoing.count).to eq(1)
|
||||
expect(conversation.messages.last.content).to eq('Hey, welcome to Captain Specs')
|
||||
|
||||
@@ -35,9 +35,9 @@ RSpec.describe Account, type: :model do
|
||||
:enterprise => { :documents => 300, :responses => 500 }
|
||||
}.with_indifferent_access
|
||||
end
|
||||
let!(:account) { create(:account, { custom_attributes: { plan_name: 'startups' } }) }
|
||||
let!(:assistant) { create(:captain_assistant, account: account) }
|
||||
let!(:document) { create(:captain_document, assistant: assistant, account: account, status: :available) }
|
||||
let(:account) { create(:account, { custom_attributes: { plan_name: 'startups' } }) }
|
||||
let(:assistant) { create(:captain_assistant, account: account) }
|
||||
let(:document) { create(:captain_document, assistant: assistant, account: account, status: :available) }
|
||||
|
||||
before do
|
||||
create(:installation_config, name: 'ACCOUNT_AGENTS_LIMIT', value: 20)
|
||||
|
||||
@@ -6,8 +6,8 @@ RSpec.describe Captain::Copilot::ChatService do
|
||||
let(:assistant) { create(:captain_assistant, account: account) }
|
||||
let(:captain_inbox_association) { create(:captain_inbox, captain_assistant: assistant, inbox: inbox) }
|
||||
|
||||
let(:mock_captain_agent) { instance_double('Captain::Agent') }
|
||||
let(:mock_captain_tool) { instance_double('Captain::Tool') }
|
||||
let(:mock_captain_agent) { instance_double(Captain::Agent) }
|
||||
let(:mock_captain_tool) { instance_double(Captain::Tool) }
|
||||
|
||||
describe '#execure' do
|
||||
before do
|
||||
|
||||
@@ -37,7 +37,7 @@ describe Enterprise::Billing::HandleStripeEventService do
|
||||
end
|
||||
|
||||
describe '#perform' do
|
||||
context 'handle customer.subscription.updated' do
|
||||
context 'when it gets customer.subscription.updated event' do
|
||||
it 'updates subscription attributes' do
|
||||
allow(event).to receive(:type).and_return('customer.subscription.updated')
|
||||
allow(subscription).to receive(:customer).and_return('cus_123')
|
||||
|
||||
Reference in New Issue
Block a user