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