mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-07-24 06:53:41 +00:00
DEV: Rename spec (#1344)
This has nothing to do with `assets:precompile`. Likely a copy/paste from another spec
This commit is contained in:
parent
77d3a38e49
commit
381fa14158
@ -2,26 +2,24 @@
|
||||
|
||||
require_relative "../support/sentiment_inference_stubs"
|
||||
|
||||
RSpec.describe "assets:precompile" do
|
||||
RSpec.describe "ai:sentiment:backfill" do
|
||||
before do
|
||||
Rake::Task.clear
|
||||
Discourse::Application.load_tasks
|
||||
end
|
||||
|
||||
describe "ai:sentiment:backfill" do
|
||||
before do
|
||||
SiteSetting.ai_sentiment_model_configs =
|
||||
"[{\"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\"}]"
|
||||
end
|
||||
before do
|
||||
SiteSetting.ai_sentiment_model_configs =
|
||||
"[{\"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\"}]"
|
||||
end
|
||||
|
||||
it "does nothing if the topic is soft-deleted" do
|
||||
target = Fabricate(:post)
|
||||
SentimentInferenceStubs.stub_classification(target)
|
||||
target.topic.trash!
|
||||
it "does nothing if the topic is soft-deleted" do
|
||||
target = Fabricate(:post)
|
||||
SentimentInferenceStubs.stub_classification(target)
|
||||
target.topic.trash!
|
||||
|
||||
path = Rake::Task["ai:sentiment:backfill"].invoke
|
||||
Rake::Task["ai:sentiment:backfill"].invoke
|
||||
|
||||
expect(ClassificationResult.count).to be_zero
|
||||
end
|
||||
expect(ClassificationResult.count).to be_zero
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user