Sha256: c5bfc05495d3fab4b76626a3f248aecb10da60ea355712e30237566c057d8ee1

Contents?: true

Size: 993 Bytes

Versions: 11

Compression:

Stored size: 993 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class Muck::CartsControllerTest < ActionController::TestCase

  tests Muck::CartsController

  context "GET show" do
    context "not logged in - empty cart" do
      setup do
        get :show
      end
      should_not_set_the_flash
      should_respond_with :success
      should_render_template :show
    end
    context "not logged in - nonempty cart" do
      setup do
        @cart       = Factory(:cart)
        @request.cookies[:cart_token] = @cart.token
        get :show
      end
      should_not_set_the_flash
      should_respond_with :success
      should_render_template :show
    end
    context "logged in as owner" do
      setup do
        @user       = Factory(:user)
        @cart       = Factory(:cart, :cartable => @user)
        login_as @user
        get :show, :user_id => @user.login
      end
      should_not_set_the_flash
      should_respond_with :success
      should_render_template :show
    end
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
muck-commerce-0.2.8 test/rails_root/test/functional/carts_controller_test.rb
muck-commerce-0.2.7 test/rails_root/test/functional/carts_controller_test.rb
muck-commerce-0.2.6 test/rails_root/test/functional/carts_controller_test.rb
muck-commerce-0.2.5 test/rails_root/test/functional/carts_controller_test.rb
muck-commerce-0.2.4 test/rails_root/test/functional/carts_controller_test.rb
muck-commerce-0.2.3 test/rails_root/test/functional/carts_controller_test.rb
muck-commerce-0.2.2 test/rails_root/test/functional/carts_controller_test.rb
muck-commerce-0.2.1 test/rails_root/test/functional/carts_controller_test.rb
muck-commerce-0.2.0 test/rails_root/test/functional/carts_controller_test.rb
muck-commerce-0.1.9 test/rails_root/test/functional/carts_controller_test.rb
muck-commerce-0.1.8 test/rails_root/test/functional/carts_controller_test.rb