3 class Post2sControllerTest < ActionController::TestCase
8 test "should get index" do
10 assert_response :success
11 assert_not_nil assigns(:post2s)
14 test "should get new" do
16 assert_response :success
19 test "should create post2" do
20 assert_difference('Post2.count') do
21 post :create, post2: { content: @post2.content, name: @post2.name, title: @post2.title }
24 assert_redirected_to post2_path(assigns(:post2))
27 test "should show post2" do
29 assert_response :success
32 test "should get edit" do
34 assert_response :success
37 test "should update post2" do
38 put :update, id: @post2, post2: { content: @post2.content, name: @post2.name, title: @post2.title }
39 assert_redirected_to post2_path(assigns(:post2))
42 test "should destroy post2" do
43 assert_difference('Post2.count', -1) do
44 delete :destroy, id: @post2
47 assert_redirected_to post2s_path