0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-13 13:17:29 +08:00
discourse/plugins/discourse-assign/spec/models/user_custom_field_spec.rb

17 lines
448 B
Ruby
Vendored

# frozen_string_literal: true
RSpec.describe UserCustomField do
before { SiteSetting.assign_enabled = true }
let(:field_name) { PendingAssignsReminder::REMINDERS_FREQUENCY }
let(:new_field) { UserCustomField.new(name: field_name, user_id: 1) }
it "coerces the value to be an integer" do
new_field.value = "DROP TABLE USERS;"
new_field.save!
saved_field = new_field.reload
expect(saved_field.value).to eq("0")
end
end