Sha256: 115afa384c07232a74d1f263869e52a1ae61ca0acf0af7c9775206f5ab5a9999

Contents?: true

Size: 1.94 KB

Versions: 9

Compression:

Stored size: 1.94 KB

Contents

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

describe Admin::Shop::CustomersController do
  
  dataset :shop_customers, :users
  
  before(:each) do
    login_as  :admin
  end
  
  describe '#new' do
    context 'instance variables' do
      it 'should be assigned' do
        get :new
        
        assigns(:inputs).should   === ['name','email']
        assigns(:meta).should     === ['login','password','password_confirmation']
        assigns(:buttons).should  === []
        assigns(:parts).should    === []
        assigns(:popups).should   === []
      end
    end
  end
  
  describe '#edit' do
    context 'instance variables' do
      it 'should be assigned' do
        get :edit, :id => shop_customers(:customer).id
        
        assigns(:inputs).should   === ['name','email']
        assigns(:meta).should     === ['login','password','password_confirmation']
        assigns(:buttons).should  === []
        assigns(:parts).should    === ['orders','addresses']
        assigns(:popups).should   === []
      end
    end
  end
  
  describe '#create' do
    context 'instance variables' do
      it 'should be assigned' do
        post :create, :shop_customer => {}
        
        assigns(:inputs).should   === ['name','email']
        assigns(:meta).should     === ['login','password','password_confirmation']
        assigns(:buttons).should  === []
        assigns(:parts).should    === []
        assigns(:popups).should   === []
      end
    end
  end
  
  describe '#update' do
    context 'instance variables' do
      it 'should be assigned' do
        put :update, :id => shop_customers(:customer).id, :shop_customer => {}
        
        assigns(:inputs).should   === ['name','email']
        assigns(:meta).should     === ['login','password','password_confirmation']
        assigns(:buttons).should  === []
        assigns(:parts).should    === ['orders','addresses']
        assigns(:popups).should   === []
      end
    end
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
radiant-shop-extension-0.92.1 spec/controllers/admin/shop/customers_controller_spec.rb
radiant-shop-extension-0.92.0 spec/controllers/admin/shop/customers_controller_spec.rb
radiant-shop-extension-0.91.7 spec/controllers/admin/shop/customers_controller_spec.rb
radiant-shop-extension-0.91.4 spec/controllers/admin/shop/customers_controller_spec.rb
radiant-shop-extension-0.91.3 spec/controllers/admin/shop/customers_controller_spec.rb
radiant-shop-extension-0.91.2 spec/controllers/admin/shop/customers_controller_spec.rb
radiant-shop-extension-0.90.4 spec/controllers/admin/shop/customers_controller_spec.rb
radiant-shop-extension-0.90.2 spec/controllers/admin/shop/customers_controller_spec.rb
radiant-shop-extension-0.90.1 spec/controllers/admin/shop/customers_controller_spec.rb