changelog shortlog tags changeset manifest revisions annotate raw

test/functional/order_items_controller_test.rb

changeset 12: 755229281e85
child:e280ef17cd5a
author: moriq <moriq@moriq.com>
date: Mon Mar 10 03:51:59 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add scaffold order_item.
1require File.dirname(__FILE__) + '/../test_helper'
2
3class OrderItemsControllerTest < ActionController::TestCase
4 def test_should_get_index
5 get :index
6 assert_response :success
7 assert_not_nil assigns(:order_items)
8 end
9
10 def test_should_get_new
11 get :new
12 assert_response :success
13 end
14
15 def test_should_create_order_item
16 assert_difference('OrderItem.count') do
17 post :create, :order_item => { }
18 end
19
20 assert_redirected_to order_item_path(assigns(:order_item))
21 end
22
23 def test_should_show_order_item
24 get :show, :id => order_items(:moriq_carrot).id
25 assert_response :success
26 end
27
28 def test_should_get_edit
29 get :edit, :id => order_items(:moriq_carrot).id
30 assert_response :success
31 end
32
33 def test_should_update_order_item
34 put :update, :id => order_items(:moriq_carrot).id, :order_item => { }
35 assert_redirected_to order_item_path(assigns(:order_item))
36 end
37
38 def test_should_destroy_order_item
39 assert_difference('OrderItem.count', -1) do
40 delete :destroy, :id => order_items(:moriq_carrot).id
41 end
42
43 assert_redirected_to order_items_path
44 end
45end