Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit b6a88ff

Browse files
committed
spec
1 parent f366ded commit b6a88ff

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

spec/requests/ai_helper/assistant_controller_spec.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# frozen_string_literal: true
22

33
RSpec.describe DiscourseAi::AiHelper::AssistantController do
4-
before { assign_fake_provider_to(:ai_helper_model) }
4+
fab!(:fake_model)
55
fab!(:newuser)
66
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
77

8+
before do
9+
SiteSetting.ai_default_llm_model = "custom:#{fake_model.id}"
10+
end
11+
812
describe "#stream_suggestion" do
913
before do
1014
Jobs.run_immediately!
@@ -305,8 +309,6 @@
305309
end
306310
let(:bad_caption) { "A picture of a cat \nsitting on a |table|" }
307311

308-
before { assign_fake_provider_to(:ai_helper_image_caption_model) }
309-
310312
def request_caption(params, caption = "A picture of a cat sitting on a table")
311313
DiscourseAi::Completions::Llm.with_prepared_responses([caption]) do
312314
post "/discourse-ai/ai-helper/caption_image", params: params
@@ -411,7 +413,6 @@ def request_caption(params, caption = "A picture of a cat sitting on a table")
411413
SiteSetting.provider = SiteSettings::DbProvider.new(SiteSetting)
412414
setup_s3
413415
stub_s3_store
414-
assign_fake_provider_to(:ai_helper_image_caption_model)
415416
SiteSetting.secure_uploads = true
416417
SiteSetting.composer_ai_helper_allowed_groups = Group::AUTO_GROUPS[:trust_level_1]
417418

0 commit comments

Comments
 (0)