Sha256: f3de79b515d8912c1f3b032748c4ba4871a90a8d227c4adae6bae637c195d62a

Contents?: true

Size: 848 Bytes

Versions: 2

Compression:

Stored size: 848 Bytes

Contents

require "spec_helper"

describe Mongoid::Associations do

  before do
    Person.delete_all; Game.delete_all; Post.delete_all
  end

  # context "one-to-one relational associations" do

    # before do
      # @person = Person.new(:title => "Sir")
      # @game = Game.new(:score => 1)
      # @person.game = @game
      # @person.save
    # end

    # it "sets the association on save" do
      # @from_db = Person.find(@person.id)
      # @from_db.game.should == @game
    # end

  # end

  context "one-to_many relational associations" do

    before do
      @person = Person.new(:title => "Sir")
      @post = Post.new(:title => "Testing")
      @person.posts = [@post]
      @person.save
    end

    it "sets the association on save" do
      # @from_db = Person.find(@person.id)
      # @from_db.posts.should == [@post]
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongoid-0.9.8 spec/integration/mongoid/associations_spec.rb
mongoid-0.9.7 spec/integration/mongoid/associations_spec.rb