A platform for community discussion. Free, open, simple.
FIX: forward force as a keyword argument in the TopicAssigner shim (#42897)
Ary Rabelo7766dc04d0f7
diff --git a/plugins/discourse-assign/lib/topic_assigner.rb b/plugins/discourse-assign/lib/topic_assigner.rbindex 1bdc903f0b6..d13be23f7e9 100644--- a/plugins/discourse-assign/lib/topic_assigner.rb+++ b/plugins/discourse-assign/lib/topic_assigner.rb@@ -13,7 +13,7 @@ class ::TopicAssignerdef self.auto_assign(post, force: false)deprecation_note- Assigner.auto_assign(post, force)+ Assigner.auto_assign(post, force: force)enddef self.is_last_staff_post?(post)diff --git a/plugins/discourse-assign/spec/lib/topic_assigner_spec.rb b/plugins/discourse-assign/spec/lib/topic_assigner_spec.rbnew file mode 100644index 00000000000..5e7ad7fbf65--- /dev/null+++ b/plugins/discourse-assign/spec/lib/topic_assigner_spec.rb@@ -0,0 +1,21 @@+# frozen_string_literal: true++RSpec.describe TopicAssigner do+ describe ".auto_assign" do+ let(:post) { instance_double(Post) }++ before { allow(Assigner).to receive(:auto_assign) }++ it "forwards force to Assigner as a keyword argument" do+ described_class.auto_assign(post, force: true)++ expect(Assigner).to have_received(:auto_assign).with(post, force: true)+ end++ it "forwards the default force value as a keyword argument" do+ described_class.auto_assign(post)++ expect(Assigner).to have_received(:auto_assign).with(post, force: false)+ end+ end+end