Sha256: 0de3898d45d3a4aa400dcef80767b613a49439aacf2025b4a99703791a442b13

Contents?: true

Size: 522 Bytes

Versions: 54

Compression:

Stored size: 522 Bytes

Contents

require "spec_helper"

describe Mongoid::Relations::Cascading::Nullify do

  let(:person) do
    Person.new
  end

  describe "#cascade" do

    let(:relation) do
      double
    end

    let(:metadata) do
      double(name: :posts)
    end

    let(:strategy) do
      described_class.new(person, metadata)
    end

    before do
      expect(person).to receive(:posts).and_return(relation)
    end

    it "nullifies the relation" do
      expect(relation).to receive(:nullify)
      strategy.cascade
    end
  end
end

Version data entries

54 entries across 49 versions & 3 rubygems

Version Path
mongoid-6.4.8 spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-6.4.7 spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-6.4.5 spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-5.4.1 spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-6.4.4 spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-6.4.2 spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-6.4.1 spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-5.4.0 spec/mongoid/relations/cascading/nullify_spec.rb
tdiary-5.0.8 vendor/bundle/gems/mongoid-6.4.0/spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-6.4.0 spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-6.3.0 spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-6.2.1 spec/mongoid/relations/cascading/nullify_spec.rb
tdiary-5.0.5 vendor/bundle/gems/mongoid-6.2.0/spec/mongoid/relations/cascading/nullify_spec.rb
tdiary-5.0.5 vendor/bundle/gems/mongoid-6.1.0/spec/mongoid/relations/cascading/nullify_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/mongoid-6.1.0/spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-6.2.0 spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-6.1.1 spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-5.2.1 spec/mongoid/relations/cascading/nullify_spec.rb
tdiary-5.0.4 vendor/bundle/gems/mongoid-6.1.0/spec/mongoid/relations/cascading/nullify_spec.rb
mongoid-6.1.0 spec/mongoid/relations/cascading/nullify_spec.rb