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

Commit 3b96303

Browse files
committed
FIX: spam controller specs
1 parent 2d5a1c8 commit 3b96303

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spec/requests/admin/ai_spam_controller_spec.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,10 @@
209209

210210
describe "#show" do
211211
context "when logged in as admin" do
212-
before { sign_in(admin) }
212+
before do
213+
sign_in(admin)
214+
AiModerationSetting.create!(setting_type: :spam, llm_model_id: llm_model.id)
215+
end
213216

214217
it "correctly filters seeded llms" do
215218
SiteSetting.ai_spam_detection_enabled = true
@@ -248,7 +251,7 @@
248251
it "return proper settings when spam detection is enabled" do
249252
SiteSetting.ai_spam_detection_enabled = true
250253

251-
AiModerationSetting.create(
254+
AiModerationSetting.update!(
252255
{
253256
setting_type: :spam,
254257
llm_model_id: llm_model.id,

0 commit comments

Comments
 (0)