From eb93e1736b11b29f957ea518c57431db16299200 Mon Sep 17 00:00:00 2001 From: Keegan George Date: Thu, 17 Jul 2025 14:46:15 -0700 Subject: [PATCH] =?UTF-8?q?Final=20spec=20fix=20=F0=9F=A4=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/configuration/llm_validator_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/configuration/llm_validator_spec.rb b/spec/configuration/llm_validator_spec.rb index 9e91a883..16a5fc77 100644 --- a/spec/configuration/llm_validator_spec.rb +++ b/spec/configuration/llm_validator_spec.rb @@ -5,6 +5,7 @@ require "rails_helper" describe DiscourseAi::Configuration::LlmValidator do describe "#valid_value?" do let(:validator) { described_class.new(name: :ai_default_llm_model) } + fab!(:llm_model) before do assign_fake_provider_to(:ai_default_llm_model) @@ -34,7 +35,10 @@ describe DiscourseAi::Configuration::LlmValidator do it "returns true for non-empty values regardless of module state" do SiteSetting.ai_helper_enabled = true SiteSetting.ai_summarization_enabled = true - expect(validator.valid_value?("some_model")).to eq(true) + + DiscourseAi::Completions::Llm.with_prepared_responses([true]) do + expect(validator.valid_value?(llm_model)).to eq(true) + end end end end