Sha256: ec6317be9c56c7630caccc4a80cf57056b4b3d54fb8b95e246d36b705e6800a5

Contents?: true

Size: 521 Bytes

Versions: 20

Compression:

Stored size: 521 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

require 'spec_helper'

describe 'embeds_one associations' do

  context 're-associating the same object' do
    context 'with dependent: destroy' do
      let(:canvas) do
        Canvas.create!(palette: Palette.new)
      end

      let!(:palette) { canvas.palette }

      it 'does not destroy the dependent object' do
        canvas.palette = canvas.palette
        canvas.save!
        canvas.reload
        canvas.palette.should == palette
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
mongoid-7.3.5 spec/integration/associations/embeds_one_spec.rb
mongoid-7.3.4 spec/integration/associations/embeds_one_spec.rb
mongoid-7.1.11 spec/integration/associations/embeds_one_spec.rb
mongoid-7.2.6 spec/integration/associations/embeds_one_spec.rb
mongoid-7.3.3 spec/integration/associations/embeds_one_spec.rb
mongoid-7.3.2 spec/integration/associations/embeds_one_spec.rb
mongoid-7.2.5 spec/integration/associations/embeds_one_spec.rb
mongoid-7.1.10 spec/integration/associations/embeds_one_spec.rb
mongoid-7.1.9 spec/integration/associations/embeds_one_spec.rb
mongoid-7.2.4 spec/integration/associations/embeds_one_spec.rb
mongoid-7.3.1 spec/integration/associations/embeds_one_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/spec/integration/associations/embeds_one_spec.rb
mongoid-7.3.0 spec/integration/associations/embeds_one_spec.rb
mongoid-7.2.3 spec/integration/associations/embeds_one_spec.rb
mongoid-7.1.8 spec/integration/associations/embeds_one_spec.rb
mongoid-7.2.2 spec/integration/associations/embeds_one_spec.rb
mongoid-7.2.1 spec/integration/associations/embeds_one_spec.rb
mongoid-7.1.7 spec/integration/associations/embeds_one_spec.rb
mongoid-7.2.0 spec/integration/associations/embeds_one_spec.rb
mongoid-7.1.6 spec/integration/associations/embeds_one_spec.rb