mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-07-01 20:12:15 +00:00
This PR moves translations into an AI Feature See https://github.com/discourse/discourse-ai/pull/1424 for screenshots
33 lines
891 B
Ruby
33 lines
891 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(6)
|
|
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["module_name"]).to eq("summarization")
|
|
end
|
|
end
|
|
end
|