Sha256: 0a166dff2f275a6c4c20c9cc59ffe334b75b13fbcdfabf8c9ba2023df4ac2f3a

Contents?: true

Size: 888 Bytes

Versions: 22

Compression:

Stored size: 888 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

module ConstructorPages
  describe Template do
    before :each do
      Template.delete_all
    end

    it 'should be valid' do
      _template = Template.create name: 'Page template', code_name: 'page_template'
      _template.valid?.should be_true
    end

    it 'should be uniqueness with Page' do
      _template = Template.create name: 'Page', code_name: 'get_field_value'
      _template.valid?.should be_false
    end

    describe '#child' do
      it 'should return child corresponding child_id or children first' do
        _brand = Template.create name: 'Brand', code_name: 'brand'
        _series = Template.create name: 'Series', code_name: 'series', parent: _brand
        _brand.reload

        _brand.child.should == _series
        _brand.child_id = _brand.id

        _brand.child.should == _brand
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
constructor-pages-0.8.5 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.8.4 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.8.3 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.8.2 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.8.1 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.8.0 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.7.10 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.7.9 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.7.8 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.7.7 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.7.6 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.7.5 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.7.4 spec/models/constructor_pages/template_spec.rb
constructor-pages-0.7.3 pages/spec/models/constructor_pages/template_spec.rb
constructor-core-0.7.3 pages/spec/models/constructor_pages/template_spec.rb
constructor-cms-0.7.3 pages/spec/models/constructor_pages/template_spec.rb
constructor-pages-0.7.2 pages/spec/models/constructor_pages/template_spec.rb
constructor-core-0.7.2 pages/spec/models/constructor_pages/template_spec.rb
constructor-cms-0.7.2 pages/spec/models/constructor_pages/template_spec.rb
constructor-core-0.7.1 pages/spec/models/constructor_pages/template_spec.rb