Sha256: e0e293b0fa46c4b29e5d4c1ab7983631774c131f90a3daf12dd2de2761fd46b0

Contents?: true

Size: 948 Bytes

Versions: 2

Compression:

Stored size: 948 Bytes

Contents

require 'spec_helper'

module MechanizeStore
  describe MechanizeStore::OrdersController do
    routes { MechanizeStore::Engine.routes }

    before do
      @payment_type = FactoryGirl.create(:mechanize_store_payment_type)
      @payment = FactoryGirl.create(:mechanize_store_payment, payment_type: @payment_type)
      @order_status = FactoryGirl.create(:mechanize_store_order_status)
      @order = FactoryGirl.create(:mechanize_store_order, payment: @payment, order_status: @order_status)
    end

    let(:valid_session) { {} }

    describe "GET index" do
      it "assigns all order_statuses as @order_statuses" do
        get :index, {}, valid_session

        assigns(:orders).should eq([@order])
      end
    end

    describe "GET show" do
      it "assigns the requested order_status as @order_status" do
        get :show, {:id => @order.to_param}, valid_session
        assigns(:order).should eq(@order)
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mechanize_store-0.0.5 spec/controllers/mechanize_store/orders_controller_spec.rb
mechanize_store-0.0.4 spec/controllers/mechanize_store/orders_controller_spec.rb