305a2610b8e9178a281890aa55addcd486f381e3
[depot.git] / test / functional / line_items_controller_test.rb
1 require 'test_helper'
2
3 class LineItemsControllerTest < ActionController::TestCase
4 test "should get index" do
5 get :index
6 assert_response :success
7 assert_not_nil assigns(:line_items)
8 end
9
10 test "should get new" do
11 get :new
12 assert_response :success
13 end
14
15 test "should create line_item" do
16 assert_difference('LineItem.count') do
17 post :create, :line_item => { }
18 end
19
20 assert_redirected_to line_item_path(assigns(:line_item))
21 end
22
23 test "should show line_item" do
24 get :show, :id => line_items(:one).id
25 assert_response :success
26 end
27
28 test "should get edit" do
29 get :edit, :id => line_items(:one).id
30 assert_response :success
31 end
32
33 test "should update line_item" do
34 put :update, :id => line_items(:one).id, :line_item => { }
35 assert_redirected_to line_item_path(assigns(:line_item))
36 end
37
38 test "should destroy line_item" do
39 assert_difference('LineItem.count', -1) do
40 delete :destroy, :id => line_items(:one).id
41 end
42
43 assert_redirected_to line_items_path
44 end
45 end