Sha256: 56eb503aa2968a3988f00dd716f92273f764cd3fd56d220fc83c8315a822ed26

Contents?: true

Size: 862 Bytes

Versions: 30

Compression:

Stored size: 862 Bytes

Contents

require File.dirname(__FILE__) + "/../../../spec_helper"

#
# Tests for Page extensions
#
describe Shop::Models::Page do
  
  dataset :pages, :shop_categories, :shop_products
  
  before :each do
    @page = pages(:home)
  end
  
  context 'relationships' do
    
    describe 'belongs_to :shop_category' do
      it 'should accept and return a shop_category object' do
        @shop_category = shop_categories(:bread)
        
        @page.shop_category = @shop_category
        
        @page.shop_category.should === @shop_category
      end
    end
    
    describe 'belongs_to :shop_product' do
      it 'should accept and return a shop_product object' do
        @shop_product = shop_products(:warm_bread)
        
        @page.shop_product = @shop_product
        
        @page.shop_product.should === @shop_product
      end
    end
    
  end
  
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
radiant-shop-extension-0.92.2 spec/lib/shop/models/page_spec.rb
radiant-shop-extension-0.92.1 spec/lib/shop/models/page_spec.rb
radiant-shop-extension-0.92.0 spec/lib/shop/models/page_spec.rb
radiant-shop-extension-0.91.7 spec/lib/shop/models/page_spec.rb
radiant-shop-extension-0.91.4 spec/lib/shop/models/page_spec.rb
radiant-shop-extension-0.91.3 spec/lib/shop/models/page_spec.rb
radiant-shop-extension-0.91.2 spec/lib/shop/models/page_spec.rb
radiant-shop-extension-0.90.4 spec/lib/shop/models/page_spec.rb
radiant-shop-extension-0.90.2 spec/lib/shop/models/page_spec.rb
radiant-shop-extension-0.90.1 spec/lib/shop/models/page_spec.rb