Skip to content

Commit 381fa14

Browse files
DEV: Rename spec (#1344)
This has nothing to do with `assets:precompile`. Likely a copy/paste from another spec
1 parent 77d3a38 commit 381fa14

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

spec/tasks/backfill_spec.rb

+11-13
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@
22

33
require_relative "../support/sentiment_inference_stubs"
44

5-
RSpec.describe "assets:precompile" do
5+
RSpec.describe "ai:sentiment:backfill" do
66
before do
77
Rake::Task.clear
88
Discourse::Application.load_tasks
99
end
1010

11-
describe "ai:sentiment:backfill" do
12-
before do
13-
SiteSetting.ai_sentiment_model_configs =
14-
"[{\"model_name\":\"SamLowe/roberta-base-go_emotions\",\"endpoint\":\"http://samlowe-emotion.com\",\"api_key\":\"123\"},{\"model_name\":\"j-hartmann/emotion-english-distilroberta-base\",\"endpoint\":\"http://jhartmann-emotion.com\",\"api_key\":\"123\"},{\"model_name\":\"cardiffnlp/twitter-roberta-base-sentiment-latest\",\"endpoint\":\"http://cardiffnlp-sentiment.com\",\"api_key\":\"123\"}]"
15-
end
11+
before do
12+
SiteSetting.ai_sentiment_model_configs =
13+
"[{\"model_name\":\"SamLowe/roberta-base-go_emotions\",\"endpoint\":\"http://samlowe-emotion.com\",\"api_key\":\"123\"},{\"model_name\":\"j-hartmann/emotion-english-distilroberta-base\",\"endpoint\":\"http://jhartmann-emotion.com\",\"api_key\":\"123\"},{\"model_name\":\"cardiffnlp/twitter-roberta-base-sentiment-latest\",\"endpoint\":\"http://cardiffnlp-sentiment.com\",\"api_key\":\"123\"}]"
14+
end
1615

17-
it "does nothing if the topic is soft-deleted" do
18-
target = Fabricate(:post)
19-
SentimentInferenceStubs.stub_classification(target)
20-
target.topic.trash!
16+
it "does nothing if the topic is soft-deleted" do
17+
target = Fabricate(:post)
18+
SentimentInferenceStubs.stub_classification(target)
19+
target.topic.trash!
2120

22-
path = Rake::Task["ai:sentiment:backfill"].invoke
21+
Rake::Task["ai:sentiment:backfill"].invoke
2322

24-
expect(ClassificationResult.count).to be_zero
25-
end
23+
expect(ClassificationResult.count).to be_zero
2624
end
2725
end

0 commit comments

Comments
 (0)