OSDN Git Service

uses video_id
[tdcgexplorer/nimono.git] / test / functional / thumbs_controller_test.rb
1 require 'test_helper'
2
3 class ThumbsControllerTest < ActionController::TestCase
4   test "should get index" do
5     get :index
6     assert_response :success
7     assert_not_nil assigns(:thumbs)
8   end
9
10   test "should get new" do
11     get :new
12     assert_response :success
13   end
14
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' }
18     end
19
20     assert_redirected_to thumb_path(assigns(:thumb))
21   end
22
23   test "should show thumb" do
24     get :show, :id => thumbs(:one).to_param
25     assert_response :success
26   end
27
28   test "should get edit" do
29     get :edit, :id => thumbs(:one).to_param
30     assert_response :success
31   end
32
33   test "should update thumb" do
34     put :update, :id => thumbs(:one).to_param, :thumb => { }
35     assert_redirected_to thumb_path(assigns(:thumb))
36   end
37
38   test "should destroy thumb" do
39     assert_difference('Thumb.count', -1) do
40       delete :destroy, :id => thumbs(:one).to_param
41     end
42
43     assert_redirected_to thumbs_path
44   end
45 end