3 class <%= controller_class_name %>ControllerTest < ActionController::TestCase
4 test "should get index" do
6 assert_response :success
7 assert_not_nil assigns(:<%= table_name %>)
10 test "should get new" do
12 assert_response :success
15 test "should create <%= file_name %>" do
16 assert_difference('<%= class_name %>.count') do
17 post :create, :<%= file_name %> => { }
20 assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
23 test "should show <%= file_name %>" do
24 get :show, :id => <%= table_name %>(:one).to_param
25 assert_response :success
28 test "should get edit" do
29 get :edit, :id => <%= table_name %>(:one).to_param
30 assert_response :success
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 %>))
38 test "should destroy <%= file_name %>" do
39 assert_difference('<%= class_name %>.count', -1) do
40 delete :destroy, :id => <%= table_name %>(:one).to_param
43 assert_redirected_to <%= table_name %>_path