mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 22:27:49 +08:00
FIX: 🐛 Saving the same custom field array twice would raise an error
This commit is contained in:
@ -115,6 +115,14 @@ describe HasCustomFields do
|
||||
db_item.save
|
||||
expect(db_item.custom_fields).to eq({"a" => ["c", "d"]})
|
||||
|
||||
# It can be updated to the exact same value
|
||||
db_item.custom_fields.update('a' => ['c'])
|
||||
db_item.save
|
||||
expect(db_item.custom_fields).to eq({"a" => "c"})
|
||||
db_item.custom_fields.update('a' => ['c'])
|
||||
db_item.save
|
||||
expect(db_item.custom_fields).to eq({"a" => "c"})
|
||||
|
||||
db_item.custom_fields.delete('a')
|
||||
expect(db_item.custom_fields).to eq({})
|
||||
|
||||
|
Reference in New Issue
Block a user