This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3- require_relative "support/toxicity_inference_stubs"
4-
53describe Plugin ::Instance do
6- before do
7- SiteSetting . discourse_ai_enabled = true
8- SiteSetting . ai_toxicity_inference_service_api_endpoint = "http://example.com"
9- end
10-
11- describe "on reviewable_transitioned_to event" do
12- fab! ( :post )
13- fab! ( :admin )
14-
15- it "adjusts model accuracy" do
16- ToxicityInferenceStubs . stub_post_classification ( post , toxic : true )
17- SiteSetting . ai_toxicity_flag_automatically = true
18- classification = DiscourseAi ::Toxicity ::ToxicityClassification . new
19- classificator = DiscourseAi ::PostClassificator . new ( classification )
20- classificator . classify! ( post )
21- reviewable = ReviewableAiPost . find_by ( target : post )
22-
23- reviewable . perform admin , :agree_and_keep
24- accuracy = ModelAccuracy . find_by ( classification_type : classification . type )
25-
26- expect ( accuracy . flags_agreed ) . to eq ( 1 )
27- end
28- end
4+ before { SiteSetting . discourse_ai_enabled = true }
295
306 describe "current_user_serializer#ai_helper_prompts" do
317 fab! ( :user )
You can’t perform that action at this time.
0 commit comments