Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit ef5907f

Browse files
committed
DEV: Add spec
1 parent 75c6e0f commit ef5907f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

spec/requests/admin/ai_spam_controller_spec.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,26 @@
4949
expect(response.status).to eq(200)
5050
end
5151

52+
it "ensures that seeded llm ID is properly passed and allowed" do
53+
seeded_llm = Fabricate(:seeded_model)
54+
55+
SiteSetting.ai_spam_detection_model_allowed_seeded_models = [
56+
llm_model.id,
57+
seeded_llm.id,
58+
].join("|")
59+
60+
put "/admin/plugins/discourse-ai/ai-spam.json",
61+
params: {
62+
is_enabled: true,
63+
llm_model_id: seeded_llm.id,
64+
custom_instructions: "custom instructions",
65+
}
66+
expect(SiteSetting.ai_spam_detection_model_allowed_seeded_models).to eq(
67+
"#{llm_model.id}|#{seeded_llm.id}",
68+
)
69+
expect(response.status).to eq(200)
70+
end
71+
5272
it "can not enable spam detection without a model selected" do
5373
put "/admin/plugins/discourse-ai/ai-spam.json",
5474
params: {

0 commit comments

Comments
 (0)