DEV: Add a test for ensure only edited badge titles updates a users

title

Adding a test to make sure we don't regress here in the future.

Follow up to: 8a89b7e108b9f0c56dfe5506e04275024da5e310
This commit is contained in:
Blake Erickson 2020-01-22 16:40:18 -07:00
parent 65481858c2
commit e85f4f6cc8

View File

@ -472,6 +472,18 @@ RSpec.describe Admin::SiteTextsController do
# Revert
delete "/admin/customize/site_texts/badges.regular.name.json"
end
it 'does not update matching user titles when overriding non-title badge text' do
Jobs.expects(:enqueue).with(
:bulk_user_title_update,
new_title: 'Terminator',
granted_badge_id: badge.id,
action: Jobs::BulkUserTitleUpdate::UPDATE_ACTION
).never
put '/admin/customize/site_texts/badges.regular.long_description.json', params: {
site_text: { value: 'Terminator' }
}
end
end
end