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-pre-2.0.0.beta1 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-2.0.0.alpha spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.14 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.13 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.12 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.11 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.10 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.9 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.8 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.7 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-pre-2.0.0.pre spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.6 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.5 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.4 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.3 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.2 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.1 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.2.0 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.1.4 spec/unit/mongoid/extensions/nil/assimilation_spec.rb
mongoid-1.1.3 spec/unit/mongoid/extensions/nil/assimilation_spec.rb