mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #29491 from kamipo/add_test_case_for_28754
Add a test case for #28754
This commit is contained in:
commit
b37aa68ff6
1 changed files with 19 additions and 0 deletions
|
@ -169,6 +169,25 @@ module JSONSharedTestCases
|
|||
assert_not json.changed?
|
||||
end
|
||||
|
||||
def test_changes_in_place_ignores_key_order
|
||||
json = klass.new
|
||||
assert_not json.changed?
|
||||
|
||||
json.payload = { "three" => "four", "one" => "two" }
|
||||
json.save!
|
||||
json.reload
|
||||
|
||||
json.payload = { "three" => "four", "one" => "two" }
|
||||
assert_not json.changed?
|
||||
|
||||
json.payload = [{ "three" => "four", "one" => "two" }, { "seven" => "eight", "five" => "six" }]
|
||||
json.save!
|
||||
json.reload
|
||||
|
||||
json.payload = [{ "three" => "four", "one" => "two" }, { "seven" => "eight", "five" => "six" }]
|
||||
assert_not json.changed?
|
||||
end
|
||||
|
||||
def test_changes_in_place_with_ruby_object
|
||||
time = Time.now.utc
|
||||
json = klass.create!(payload: time)
|
||||
|
|
Loading…
Reference in a new issue