discourse-ai/spec/plugin_spec.rb
Sam 11d0f60f1e
FEATURE: smart date support for AI helper (#1044)
* FEATURE: smart date support for AI helper

This feature allows conversion of human typed in dates and times
to smart "Discourse" timezone friendly dates.

* fix specs and lint

* lint

* address feedback

* add specs
2024-12-31 08:04:25 +11:00

26 lines
756 B
Ruby

# frozen_string_literal: true
describe Plugin::Instance do
before { SiteSetting.discourse_ai_enabled = true }
describe "current_user_serializer#ai_helper_prompts" do
fab!(:user)
before do
assign_fake_provider_to(:ai_helper_model)
SiteSetting.ai_helper_enabled = true
SiteSetting.ai_helper_illustrate_post_model = "disabled"
Group.find_by(id: Group::AUTO_GROUPS[:admins]).add(user)
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.count).to eq(8)
end
end
end