Sha256: 3654255f7f74ac62058ddb0acabb3c31ff447ca645ccea24706749be78a4f78d

Contents?: true

Size: 562 Bytes

Versions: 32

Compression:

Stored size: 562 Bytes

Contents

require 'spec_helper'

describe Spree::Taxonomy, :type => :model do
  context "#destroy" do
    before do
       @taxonomy = create(:taxonomy)
       @root_taxon = @taxonomy.root
       @child_taxon = create(:taxon, :taxonomy_id => @taxonomy.id, :parent => @root_taxon)
    end

    it "should destroy all associated taxons" do
      @taxonomy.destroy
      expect{ Spree::Taxon.find(@root_taxon.id) }.to raise_error(ActiveRecord::RecordNotFound)
      expect{ Spree::Taxon.find(@child_taxon.id) }.to raise_error(ActiveRecord::RecordNotFound)
    end
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
solidus_core-1.2.3 spec/models/spree/taxonomy_spec.rb
solidus_core-1.1.4 spec/models/spree/taxonomy_spec.rb
solidus_core-1.0.7 spec/models/spree/taxonomy_spec.rb
spree_core-3.1.5 spec/models/spree/taxonomy_spec.rb
spree_core-3.1.4 spec/models/spree/taxonomy_spec.rb
spree_core-3.1.3 spec/models/spree/taxonomy_spec.rb
spree_core-3.1.2 spec/models/spree/taxonomy_spec.rb
spree_core-3.0.10 spec/models/spree/taxonomy_spec.rb
spree_core-3.1.1 spec/models/spree/taxonomy_spec.rb
spree_core-3.1.0 spec/models/spree/taxonomy_spec.rb
spree_core-3.1.0.rc4 spec/models/spree/taxonomy_spec.rb
spree_core-3.0.9 spec/models/spree/taxonomy_spec.rb
spree_core-3.1.0.rc3 spec/models/spree/taxonomy_spec.rb
spree_core-3.1.0.rc2 spec/models/spree/taxonomy_spec.rb
spree_core-3.1.0.rc1 spec/models/spree/taxonomy_spec.rb
solidus_core-1.0.6 spec/models/spree/taxonomy_spec.rb
spree_core-3.0.8 spec/models/spree/taxonomy_spec.rb
solidus_core-1.2.2 spec/models/spree/taxonomy_spec.rb
spree_core-3.0.7 spec/models/spree/taxonomy_spec.rb
solidus_core-1.2.1 spec/models/spree/taxonomy_spec.rb