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-8.1.4 test/test_serialize.rb
composite_primary_keys-9.0.0 test/test_serialize.rb
composite_primary_keys-9.0.0.beta1 test/test_serialize.rb
composite_primary_keys-8.1.3 test/test_serialize.rb
composite_primary_keys-8.1.2 test/test_serialize.rb
composite_primary_keys-7.0.16 test/test_serialize.rb
composite_primary_keys-7.0.15 test/test_serialize.rb
composite_primary_keys-8.1.1 test/test_serialize.rb
composite_primary_keys-7.0.14 test/test_serialize.rb
composite_primary_keys-8.1.0 test/test_serialize.rb
composite_primary_keys-7.0.13 test/test_serialize.rb
composite_primary_keys-8.0.0 test/test_serialize.rb
composite_primary_keys-7.0.12 test/test_serialize.rb
composite_primary_keys-7.0.11 test/test_serialize.rb
composite_primary_keys-7.0.10 test/test_serialize.rb
composite_primary_keys-7.0.9 test/test_serialize.rb
composite_primary_keys-7.0.8 test/test_serialize.rb
composite_primary_keys-7.0.7 test/test_serialize.rb
composite_primary_keys-7.0.6 test/test_serialize.rb
composite_primary_keys-7.0.5 test/test_serialize.rb