@@ -20,7 +20,7 @@ def execute(expression:)
2020
2121 # Basic functionality tests using dummy app models
2222 describe 'basic chat functionality' do
23- it 'persists chat history' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
23+ it 'persists chat history' do
2424 chat = Chat . create! ( model_id : model )
2525 chat . ask ( "What's your favorite Ruby feature?" )
2626
@@ -33,7 +33,7 @@ def execute(expression:)
3333 expect ( chat . updated_at ) . to eq ( chat . messages . last . chat . updated_at )
3434 end
3535
36- it 'tracks token usage' do # rubocop:disable RSpec/MultipleExpectations
36+ it 'tracks token usage' do
3737 chat = Chat . create! ( model_id : 'gpt-4.1-nano' )
3838 chat . ask ( 'Hello' )
3939
@@ -44,15 +44,15 @@ def execute(expression:)
4444 end
4545
4646 describe 'system messages' do
47- it 'persists system messages' do # rubocop:disable RSpec/MultipleExpectations
47+ it 'persists system messages' do
4848 chat = Chat . create! ( model_id : model )
4949 chat . with_instructions ( 'You are a Ruby expert' )
5050
5151 expect ( chat . messages . first . role ) . to eq ( 'system' )
5252 expect ( chat . messages . first . content ) . to eq ( 'You are a Ruby expert' )
5353 end
5454
55- it 'replaces system messages when requested' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
55+ it 'replaces system messages when requested' do
5656 chat = Chat . create! ( model_id : model )
5757
5858 chat . with_instructions ( 'Be helpful' )
@@ -66,7 +66,7 @@ def execute(expression:)
6666 end
6767
6868 describe 'tool usage' do
69- it 'persists tool calls' do # rubocop:disable RSpec/MultipleExpectations
69+ it 'persists tool calls' do
7070 chat = Chat . create! ( model_id : model )
7171 chat . with_tool ( Calculator )
7272
@@ -95,7 +95,7 @@ def execute(expression:)
9595 end
9696
9797 describe 'structured output' do
98- it 'supports with_schema for structured responses' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
98+ it 'supports with_schema for structured responses' do
9999 chat = Chat . create! ( model_id : model )
100100
101101 schema = {
@@ -132,7 +132,7 @@ def execute(expression:)
132132 end
133133
134134 describe 'error handling' do
135- it 'destroys empty assistant messages on API failure' do # rubocop:disable RSpec/MultipleExpectations
135+ it 'destroys empty assistant messages on API failure' do
136136 chat = Chat . create! ( model_id : model )
137137
138138 # Stub the API to fail
@@ -210,7 +210,7 @@ class BotToolCall < ActiveRecord::Base # rubocop:disable Lint/ConstantDefinition
210210 end
211211
212212 describe 'namespaced chat models' do
213- it 'works with namespaced classes and custom associations' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
213+ it 'works with namespaced classes and custom associations' do
214214 bot_chat = Assistants ::BotChat . create! ( model_id : model )
215215 bot_chat . ask ( "What's 2 + 2?" )
216216
@@ -221,7 +221,7 @@ class BotToolCall < ActiveRecord::Base # rubocop:disable Lint/ConstantDefinition
221221 expect ( bot_chat . messages . last . content ) . to be_present
222222 end
223223
224- it 'persists tool calls with custom classes' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
224+ it 'persists tool calls with custom classes' do
225225 bot_chat = Assistants ::BotChat . create! ( model_id : model )
226226 bot_chat . with_tool ( Calculator )
227227
@@ -233,7 +233,7 @@ class BotToolCall < ActiveRecord::Base # rubocop:disable Lint/ConstantDefinition
233233 expect ( tool_call_message . tool_calls . first ) . to be_a ( BotToolCall )
234234 end
235235
236- it 'handles system messages correctly' do # rubocop:disable RSpec/MultipleExpectations
236+ it 'handles system messages correctly' do
237237 bot_chat = Assistants ::BotChat . create! ( model_id : model )
238238 bot_chat . with_instructions ( 'You are a helpful bot' )
239239
@@ -252,7 +252,7 @@ class BotToolCall < ActiveRecord::Base # rubocop:disable Lint/ConstantDefinition
252252 end
253253
254254 describe 'to_llm conversion' do
255- it 'correctly converts custom messages to RubyLLM format' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
255+ it 'correctly converts custom messages to RubyLLM format' do
256256 bot_chat = Assistants ::BotChat . create! ( model_id : model )
257257 bot_message = bot_chat . messages . create! (
258258 role : 'user' ,
@@ -269,7 +269,7 @@ class BotToolCall < ActiveRecord::Base # rubocop:disable Lint/ConstantDefinition
269269 expect ( llm_message . output_tokens ) . to eq ( 20 )
270270 end
271271
272- it 'correctly converts tool calls' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
272+ it 'correctly converts tool calls' do
273273 bot_chat = Assistants ::BotChat . create! ( model_id : model )
274274 bot_message = bot_chat . messages . create! ( role : 'assistant' , content : 'I need to calculate something' )
275275
@@ -317,7 +317,7 @@ def uploaded_file(path, type)
317317 )
318318 end
319319
320- it 'converts ActiveStorage attachments to RubyLLM Content' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
320+ it 'converts ActiveStorage attachments to RubyLLM Content' do
321321 chat = Chat . create! ( model_id : model )
322322
323323 message = chat . messages . create! ( role : 'user' , content : 'Check this out' )
@@ -332,7 +332,7 @@ def uploaded_file(path, type)
332332 expect ( llm_message . content . attachments . first . mime_type ) . to eq ( 'image/png' )
333333 end
334334
335- it 'handles multiple attachments' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
335+ it 'handles multiple attachments' do
336336 chat = Chat . create! ( model_id : model )
337337
338338 image_upload = uploaded_file ( image_path , 'image/png' )
@@ -345,7 +345,7 @@ def uploaded_file(path, type)
345345 expect ( response . content ) . to be_present
346346 end
347347
348- it 'handles attachments in ask method' do # rubocop:disable RSpec/ExampleLength,RSpec/MultipleExpectations
348+ it 'handles attachments in ask method' do
349349 chat = Chat . create! ( model_id : model )
350350
351351 image_upload = uploaded_file ( image_path , 'image/png' )
@@ -358,7 +358,7 @@ def uploaded_file(path, type)
358358 end
359359
360360 describe 'attachment types' do
361- it 'handles images' do # rubocop:disable RSpec/ExampleLength
361+ it 'handles images' do
362362 chat = Chat . create! ( model_id : model )
363363 message = chat . messages . create! ( role : 'user' , content : 'Image test' )
364364
@@ -373,7 +373,7 @@ def uploaded_file(path, type)
373373 expect ( attachment . type ) . to eq ( :image )
374374 end
375375
376- it 'handles PDFs' do # rubocop:disable RSpec/ExampleLength
376+ it 'handles PDFs' do
377377 chat = Chat . create! ( model_id : model )
378378 message = chat . messages . create! ( role : 'user' , content : 'PDF test' )
379379
0 commit comments