Sha256: 40649393cc5c43cb80df59da3524295487a4f893c0cca0e3bef7292aadb0df23

Contents?: true

Size: 604 Bytes

Versions: 3

Compression:

Stored size: 604 Bytes

Contents

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

class AssociationTest < MiniTest::Unit::TestCase

  def setup
    super

    @pig = Pig.create!(:name => "Henwen")
    @vision = Vision.create!(:pronouncement => "It was a dark and stormy night...", :pig => @pig)
    @pig.visions.add @vision
  end

  def test_timeline
    assert_equal @pig.visions.page.events.first.resource, @vision
    assert @pig.visions.page.events.first.resource.pronouncement
  end

  def test_reference
    assert_equal @vision.pig, @pig
    assert_equal @vision.pig_ref, @pig.ref
    assert @vision.pig.visions
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fauna-0.1.2 test/model/association_test.rb
fauna-0.1.1 test/model/association_test.rb
fauna-0.1 test/model/association_test.rb