Sha256: b4116fbebb6c93e05127dfbfede47b3e47aee572503fc49314198290bbe44a2d

Contents?: true

Size: 744 Bytes

Versions: 15

Compression:

Stored size: 744 Bytes

Contents

require 'test_helper'

class UsersControllerTest < ActionController::TestCase
  context "on get to :show" do
    setup do
      user = Factory(:user)
      @completed_order = Factory(:order, :user => user)
      @incomplete_order = Factory(:order, :user => user)
      @completed_order.send(:complete_order)

      @controller.stub!(:current_user, :return => user)
      get :show, :id => user.id.to_s
    end
    should_respond_with :success
    should_assign_to :orders
    context "@orders" do
      should "include complete orders" do
        assert assigns(:orders).include?(@completed_order)
      end
      should "not include incomplete orders" do
        assert !assigns(:orders).include?(@incomplete_order)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
spree-0.11.4 test/functional/users_controller_test.rb
spree-0.11.3 test/functional/users_controller_test.rb
spree-0.11.2 test/functional/users_controller_test.rb
spree-0.11.1 test/functional/users_controller_test.rb
spree-0.11.0 test/functional/users_controller_test.rb
spree-0.10.2 test/functional/users_controller_test.rb
spree-0.10.1 test/functional/users_controller_test.rb
spree-0.10.0 test/functional/users_controller_test.rb
spree-0.10.0.beta test/functional/users_controller_test.rb
spree-enriquez-0.9.4 test/functional/users_controller_test.rb
spree-0.9.4 test/functional/users_controller_test.rb
spree-0.9.3 test/functional/users_controller_test.rb
spree-0.9.2 test/functional/users_controller_test.rb
spree-0.9.1 test/functional/users_controller_test.rb
spree-0.9.0 test/functional/users_controller_test.rb