Sha256: c1375197499fb085b9d37d8f76943e219daa18b90d07e0ee46a494713c391fcb

Contents?: true

Size: 440 Bytes

Versions: 65

Compression:

Stored size: 440 Bytes

Contents

require File.expand_path('../abstract_unit', __FILE__)

class TestSerialization < ActiveSupport::TestCase
  fixtures :departments

  def test_json
    department = Department.first
    assert_equal('{"department_id":1,"location_id":1}', department.to_json)
  end

  def test_serializable_hash
    department = Department.first
    assert_equal({"department_id" => 1,"location_id" => 1}, department.serializable_hash)
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
composite_primary_keys-12.0.2 test/test_serialize.rb
composite_primary_keys-11.3.1 test/test_serialize.rb
composite_primary_keys-8.1.8 test/test_serialize.rb
composite_primary_keys-12.0.1 test/test_serialize.rb
composite_primary_keys-12.0.0 test/test_serialize.rb
composite_primary_keys-12.0.0.rc5 test/test_serialize.rb
composite_primary_keys-12.0.0.rc4 test/test_serialize.rb
composite_primary_keys-12.0.0.rc3 test/test_serialize.rb
composite_primary_keys-12.0.0.rc2 test/test_serialize.rb
composite_primary_keys-12.0.0.rc1 test/test_serialize.rb
composite_primary_keys-8.1.7 test/test_serialize.rb
composite_primary_keys-11.2.0 test/test_serialize.rb
composite_primary_keys-11.1.0 test/test_serialize.rb
composite_primary_keys-11.0.3 test/test_serialize.rb
composite_primary_keys-11.0.2 test/test_serialize.rb
composite_primary_keys-10.0.5 test/test_serialize.rb
composite_primary_keys-9.0.10 test/test_serialize.rb
composite_primary_keys-11.0.1 test/test_serialize.rb
composite_primary_keys-11.0.0 test/test_serialize.rb
composite_primary_keys-10.0.4 test/test_serialize.rb