mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-05-11 02:48:13 +00:00
This update adds the ability to disable search discoveries. This can be done through a tooltip when search discoveries are shown. It can also be done in the AI user preferences, which has also been updated to accommodate more than just the one image caption setting.
38 lines
949 B
Ruby
38 lines
949 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe UserOption do
|
|
fab!(:user)
|
|
fab!(:llm_model)
|
|
fab!(:group)
|
|
fab!(:ai_persona) do
|
|
Fabricate(:ai_persona, allowed_group_ids: [group.id], default_llm_id: llm_model.id)
|
|
end
|
|
|
|
before do
|
|
assign_fake_provider_to(:ai_helper_model)
|
|
assign_fake_provider_to(:ai_helper_image_caption_model)
|
|
SiteSetting.ai_helper_enabled = true
|
|
SiteSetting.ai_helper_enabled_features = "image_caption"
|
|
SiteSetting.ai_auto_image_caption_allowed_groups = "10" # tl0
|
|
|
|
SiteSetting.ai_bot_enabled = true
|
|
end
|
|
|
|
describe "#auto_image_caption" do
|
|
it "is present" do
|
|
expect(described_class.new.auto_image_caption).to eq(false)
|
|
end
|
|
end
|
|
|
|
describe "#ai_search_discoveries" do
|
|
before do
|
|
SiteSetting.ai_bot_discover_persona = ai_persona.id
|
|
group.add(user)
|
|
end
|
|
|
|
it "is present" do
|
|
expect(described_class.new.ai_search_discoveries).to eq(true)
|
|
end
|
|
end
|
|
end
|