Sha256: 8cd26dca1ffe244003d2a0962d902edc464a3c9b79fd700cf2d16e95ea718720

Contents?: true

Size: 498 Bytes

Versions: 25

Compression:

Stored size: 498 Bytes

Contents

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

class TestDumpable < ActiveSupport::TestCase
  fixtures :articles, :readings, :users

  def test_marshal_with_simple_preload
    articles = Article.preload(:readings).where(id: 1).to_a
    assert_equal(Marshal.load(Marshal.dump(articles)), articles)
  end

  def test_marshal_with_comples_preload
    articles = Article.preload({ readings: :user }).where(id: 1).to_a
    assert_equal(Marshal.load(Marshal.dump(articles)), articles)
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
composite_primary_keys-14.0.9 test/test_dumpable.rb
composite_primary_keys-14.0.8 test/test_dumpable.rb
composite_primary_keys-13.0.8 test/test_dumpable.rb
composite_primary_keys-14.0.7 test/test_dumpable.rb
composite_primary_keys-14.0.6 test/test_dumpable.rb
composite_primary_keys-13.0.7 test/test_dumpable.rb
composite_primary_keys-13.0.6 test/test_dumpable.rb
composite_primary_keys-14.0.5 test/test_dumpable.rb
composite_primary_keys-13.0.5 test/test_dumpable.rb
composite_primary_keys-13.0.4 test/test_dumpable.rb
composite_primary_keys-14.0.4 test/test_dumpable.rb
composite_primary_keys-14.0.3 test/test_dumpable.rb
composite_primary_keys-13.0.3 test/test_dumpable.rb
composite_primary_keys-14.0.2 test/test_dumpable.rb
composite_primary_keys-13.0.2 test/test_dumpable.rb
composite_primary_keys-14.0.1 test/test_dumpable.rb
composite_primary_keys-11.0.0.rc2 test/test_dumpable.rb
composite_primary_keys-7.0.15 test/test_dumpable.rb
composite_primary_keys-8.1.1 test/test_dumpable.rb
composite_primary_keys-7.0.14 test/test_dumpable.rb