Sha256: 9a88cafa236831e601fc75374a768afce28191fdc841818502022864dac990cf

Contents?: true

Size: 832 Bytes

Versions: 1

Compression:

Stored size: 832 Bytes

Contents

require 'spec/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

1 entries across 1 versions & 1 rubygems

Version Path
radiant-shop-extension-0.90.0 spec/lib/shop/models/page_spec.rb