discourse-ai/spec/requests/admin/ai_features_controller_spec.rb
Rafael dos Santos Silva 478f31de47
FEATURE: add inferred concepts system (#1330)
* FEATURE: add inferred concepts system

This commit adds a new inferred concepts system that:
- Creates a model for storing concept labels that can be applied to topics
- Provides AI personas for finding new concepts and matching existing ones
- Adds jobs for generating concepts from popular topics
- Includes a scheduled job that automatically processes engaging topics

* FEATURE: Extend inferred concepts to include posts

* Adds support for concepts to be inferred from and applied to posts
* Replaces daily task with one that handles both topics and posts
* Adds database migration for posts_inferred_concepts join table
* Updates PersonaContext to include inferred concepts



Co-authored-by: Roman Rizzi <rizziromanalejandro@gmail.com>
Co-authored-by: Keegan George <kgeorge13@gmail.com>
2025-06-02 14:29:20 -03:00

33 lines
918 B
Ruby

# frozen_string_literal: true
RSpec.describe DiscourseAi::Admin::AiFeaturesController do
let(:controller) { described_class.new }
fab!(:admin)
fab!(:group)
fab!(:llm_model)
fab!(:summarizer_persona) { Fabricate(:ai_persona) }
fab!(:alternate_summarizer_persona) { Fabricate(:ai_persona) }
before do
sign_in(admin)
SiteSetting.ai_bot_enabled = true
SiteSetting.discourse_ai_enabled = true
end
describe "#index" do
it "lists all features backed by personas" do
get "/admin/plugins/discourse-ai/ai-features.json"
expect(response.status).to eq(200)
expect(response.parsed_body["ai_features"].count).to eq(5)
end
end
describe "#edit" do
it "returns a success response" do
get "/admin/plugins/discourse-ai/ai-features/1/edit.json"
expect(response.parsed_body["name"]).to eq(I18n.t "discourse_ai.features.summarization.name")
end
end
end