Sha256: 76af27134a30b2dfa54dcfce3f293330e85d143aa57fb5f1c410b96f2287ba5d

Contents?: true

Size: 964 Bytes

Versions: 2

Compression:

Stored size: 964 Bytes

Contents

describe Unidom::Category::CategoryRollup, type: :model do

  before :each do
  end

  after :each do
  end

  context do

    model_attributes = {
      ancestor_category_id:   SecureRandom.uuid,
      descendant_category_id: SecureRandom.uuid
    }

    it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes

    category_attributes = {
      scheme_id:    SecureRandom.uuid,
      code:         'XC',
      name:         'Top Category',
      abbreviation: 'TopCat'
    }

    it_behaves_like 'belongs_to', model_attributes, :ancestor_category,   Unidom::Category::Category, category_attributes
    it_behaves_like 'belongs_to', model_attributes, :descendant_category, Unidom::Category::Category, category_attributes

    it_behaves_like 'monomorphic scope', model_attributes, :ancestor_category_is,   :ancestor_category
    it_behaves_like 'monomorphic scope', model_attributes, :descendant_category_is, :descendant_category

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unidom-category-1.6.6 lib/rspec/models/unidom/category/category_rollup_spec.rb
unidom-category-1.6.5 lib/rspec/models/unidom/category/category_rollup_spec.rb