Sha256: 94bdf1e5590198cec2c4cc15f5e4ff0f156fab332b63d3df07436b775ad51baf

Contents?: true

Size: 995 Bytes

Versions: 9

Compression:

Stored size: 995 Bytes

Contents

require 'spec_helper'

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

    before do
      @flag = FactoryGirl.create(:mechanize_store_flag)
      @payment = FactoryGirl.build(:mechanize_store_payment, payment_type: Payment::TYPES.invert[:credit_card], flag: @flag)
      @freight = FactoryGirl.create(:mechanize_store_freight)
      @order = FactoryGirl.create(:mechanize_store_order, payment: @payment, order_status: Order::STATUSES.invert[:submited], freight: @freight)
    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

9 entries across 9 versions & 1 rubygems

Version Path
mechanize_store-0.0.18 spec/controllers/mechanize_store/orders_controller_spec.rb
mechanize_store-0.0.17 spec/controllers/mechanize_store/orders_controller_spec.rb
mechanize_store-0.0.16 spec/controllers/mechanize_store/orders_controller_spec.rb
mechanize_store-0.0.15 spec/controllers/mechanize_store/orders_controller_spec.rb
mechanize_store-0.0.14 spec/controllers/mechanize_store/orders_controller_spec.rb
mechanize_store-0.0.13 spec/controllers/mechanize_store/orders_controller_spec.rb
mechanize_store-0.0.12 spec/controllers/mechanize_store/orders_controller_spec.rb
mechanize_store-0.0.11 spec/controllers/mechanize_store/orders_controller_spec.rb
mechanize_store-0.0.10 spec/controllers/mechanize_store/orders_controller_spec.rb