Sha256: a60a23ed8ff682e89e1f40d287879f8505bc0eceb83b87ee0d96cf91e2805684

Contents?: true

Size: 552 Bytes

Versions: 31

Compression:

Stored size: 552 Bytes

Contents

require "spec_helper"

describe Mongoid::Extensions::Nil::Assimilation do

  describe "#assimilate" do

    before do
      @name = Name.new(:first_name => "Durran")
      @parent = Person.new(:title => "Mr.", :name => @name)
      @options = Mongoid::Associations::Options.new(:name => :name)
    end

    it "removes the child attribute from the parent" do
      nil.assimilate(@parent, @options)
      @parent.attributes[:name].should be_nil
    end

    it "returns nil" do
      nil.assimilate(@parent, @options).should be_nil
    end

  end

end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
mongoid-1.1.2 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.1.1 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.1.0 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.0.6 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.0.5 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.0.4 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.0.3 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.0.2 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.0.1 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.0.0 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-0.12.0 spec/unit/mongoid/extensions/nil/assimilation_spec.rb