3 class ThumbsControllerTest < ActionController::TestCase
4 test "should get index" do
6 assert_response :success
7 assert_not_nil assigns(:thumbs)
10 test "should get new" do
12 assert_response :success
15 test "should create thumb" do
16 assert_difference('Thumb.count') do
17 post :create, :thumb => { :video_id => 'sm9996481', :title => '[MMD]Lat式ちびミクが更にちみっこになったので', :description => 'sm9983872 のあおぽん様とネタ被り記念。真逆、自分と同じ事を実行する人がいるとは思わなかったorz左から順にあおぽん様Lat式ちびミク、6666AAP様Lat式ちびミク、自作Lat式ちみっこミク、ちびミク、ぷちミクと並んでおります。音源データは、sm9201748モデルデータは sm7542126 / sm8620825 / sm9931954 / sm9983872 背景データは、sm8695572以上よりお借り致しました。ありがとうございます。改造データ:http://loda.jp/mikumikudance/?id=236' }
20 assert_redirected_to thumb_path(assigns(:thumb))
23 test "should show thumb" do
24 get :show, :id => thumbs(:one).to_param
25 assert_response :success
28 test "should get edit" do
29 get :edit, :id => thumbs(:one).to_param
30 assert_response :success
33 test "should update thumb" do
34 put :update, :id => thumbs(:one).to_param, :thumb => { }
35 assert_redirected_to thumb_path(assigns(:thumb))
38 test "should destroy thumb" do
39 assert_difference('Thumb.count', -1) do
40 delete :destroy, :id => thumbs(:one).to_param
43 assert_redirected_to thumbs_path