2024-08-08 13:37:26 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
RSpec.describe UserOption do
|
2025-03-10 14:17:58 -07:00
|
|
|
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
|
|
|
|
|
2024-08-08 13:37:26 -07:00
|
|
|
before do
|
|
|
|
assign_fake_provider_to(:ai_helper_model)
|
|
|
|
assign_fake_provider_to(:ai_helper_image_caption_model)
|
2024-08-12 15:40:23 -07:00
|
|
|
SiteSetting.ai_helper_enabled = true
|
2024-08-08 13:37:26 -07:00
|
|
|
SiteSetting.ai_helper_enabled_features = "image_caption"
|
|
|
|
SiteSetting.ai_auto_image_caption_allowed_groups = "10" # tl0
|
2025-03-10 14:17:58 -07:00
|
|
|
|
|
|
|
SiteSetting.ai_bot_enabled = true
|
2024-08-08 13:37:26 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "#auto_image_caption" do
|
|
|
|
it "is present" do
|
|
|
|
expect(described_class.new.auto_image_caption).to eq(false)
|
|
|
|
end
|
|
|
|
end
|
2025-03-10 14:17:58 -07:00
|
|
|
|
|
|
|
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
|
2024-08-08 13:37:26 -07:00
|
|
|
end
|