A few fixture fixes
[arvados.git] / test / functional / collections_controller_test.rb
1 require 'test_helper'
2
3 class CollectionsControllerTest < ActionController::TestCase
4   setup do
5     @collection = collections(:one)
6   end
7
8   test "should get index" do
9     get :index
10     assert_response :success
11     assert_not_nil assigns(:collections)
12   end
13
14   test "should get new" do
15     get :new
16     assert_response :success
17   end
18
19   test "should create collection" do
20     assert_difference('Collection.count') do
21       post :create, collection: @collection.attributes
22     end
23
24     assert_redirected_to collection_path(assigns(:collection))
25   end
26
27   test "should show collection" do
28     get :show, id: @collection.to_param
29     assert_response :success
30   end
31
32   test "should get edit" do
33     get :edit, id: @collection.to_param
34     assert_response :success
35   end
36
37   test "should update collection" do
38     put :update, id: @collection.to_param, collection: @collection.attributes
39     assert_redirected_to collection_path(assigns(:collection))
40   end
41
42   test "should destroy collection" do
43     assert_difference('Collection.count', -1) do
44       delete :destroy, id: @collection.to_param
45     end
46
47     assert_redirected_to collections_path
48   end
49 end