DEV: Fix mocha deprecations (#18828)

It now supports strict keyword argument matching by default.
This commit is contained in:
Jarek Radosz
2022-11-02 10:47:59 +01:00
committed by GitHub
parent b9bcb225f2
commit c32fe340f0
14 changed files with 45 additions and 40 deletions

View File

@@ -1289,12 +1289,12 @@ RSpec.describe Report do
end
it "caches exception reports for 1 minute" do
Discourse.cache.expects(:write).with(Report.cache_key(exception_report), exception_report.as_json, { expires_in: 1.minute })
Discourse.cache.expects(:write).with(Report.cache_key(exception_report), exception_report.as_json, expires_in: 1.minute)
Report.cache(exception_report)
end
it "caches valid reports for 35 minutes" do
Discourse.cache.expects(:write).with(Report.cache_key(valid_report), valid_report.as_json, { expires_in: 35.minutes })
Discourse.cache.expects(:write).with(Report.cache_key(valid_report), valid_report.as_json, expires_in: 35.minutes)
Report.cache(valid_report)
end
end

View File

@@ -138,7 +138,7 @@ RSpec.describe ReviewableUser, type: :model do
it "optionally sends email with reject reason" do
SiteSetting.must_approve_users = true
Jobs::CriticalUserEmail.any_instance.expects(:execute).with(type: :signup_after_reject, user_id: reviewable.target_id, reject_reason: "reject reason").once
Jobs::CriticalUserEmail.any_instance.expects(:execute).with({ type: :signup_after_reject, user_id: reviewable.target_id, reject_reason: "reject reason" }).once
reviewable.perform(moderator, :delete_user_block, reject_reason: "reject reason", send_email: true)
end