discourse/plugins/discourse-ai/spec/plugin_spec.rb
Keegan George 9ab55e9a28
DEV: Remove deprecated AI plugin settings (#37459)
## 🔍 Overview
This update ensures we follow-up on the TODO's in Discourse AI's
`settings.yml` to remove all the deprecated settings along with
description locales and usages still remaining in specs. Usage of the
settings in the plugin has been removed in the past and they have been
hidden for some time now already, so this should be a straightforward
remove.
2026-02-03 05:39:38 -08:00

33 lines
892 B
Ruby

# frozen_string_literal: true
describe Plugin::Instance do
before { enable_current_plugin }
describe "current_user_serializer#ai_helper_prompts" do
fab!(:user)
before do
assign_fake_provider_to(:ai_default_llm_model)
SiteSetting.ai_helper_enabled = true
Group.find_by(id: Group::AUTO_GROUPS[:admins]).add(user)
Group.refresh_automatic_groups!
DiscourseAi::AiHelper::Assistant.clear_prompt_cache!
end
let(:serializer) { CurrentUserSerializer.new(user, scope: Guardian.new(user)) }
it "returns the available prompts" do
expect(serializer.ai_helper_prompts).to be_present
expect(serializer.ai_helper_prompts.object.map { |p| p[:name] }).to contain_exactly(
"translate",
"generate_titles",
"proofread",
"markdown_table",
"explain",
"replace_dates",
)
end
end
end