|
Revision 1, 1.0 kB
(checked in by falcon, 17 years ago)
|
|
Version one -> initial work from the laptop.
|
| Rev | Line | |
|---|
| [1] | 1 | require File.dirname(__FILE__) + '/../test_helper' |
|---|
| 2 | |
|---|
| 3 | class GalleriesControllerTest < ActionController::TestCase |
|---|
| 4 | def test_should_get_index |
|---|
| 5 | get :index |
|---|
| 6 | assert_response :success |
|---|
| 7 | assert_not_nil assigns(:galleries) |
|---|
| 8 | end |
|---|
| 9 | |
|---|
| 10 | def test_should_get_new |
|---|
| 11 | get :new |
|---|
| 12 | assert_response :success |
|---|
| 13 | end |
|---|
| 14 | |
|---|
| 15 | def test_should_create_gallery |
|---|
| 16 | assert_difference('Gallery.count') do |
|---|
| 17 | post :create, :gallery => { } |
|---|
| 18 | end |
|---|
| 19 | |
|---|
| 20 | assert_redirected_to gallery_path(assigns(:gallery)) |
|---|
| 21 | end |
|---|
| 22 | |
|---|
| 23 | def test_should_show_gallery |
|---|
| 24 | get :show, :id => galleries(:one).id |
|---|
| 25 | assert_response :success |
|---|
| 26 | end |
|---|
| 27 | |
|---|
| 28 | def test_should_get_edit |
|---|
| 29 | get :edit, :id => galleries(:one).id |
|---|
| 30 | assert_response :success |
|---|
| 31 | end |
|---|
| 32 | |
|---|
| 33 | def test_should_update_gallery |
|---|
| 34 | put :update, :id => galleries(:one).id, :gallery => { } |
|---|
| 35 | assert_redirected_to gallery_path(assigns(:gallery)) |
|---|
| 36 | end |
|---|
| 37 | |
|---|
| 38 | def test_should_destroy_gallery |
|---|
| 39 | assert_difference('Gallery.count', -1) do |
|---|
| 40 | delete :destroy, :id => galleries(:one).id |
|---|
| 41 | end |
|---|
| 42 | |
|---|
| 43 | assert_redirected_to galleries_path |
|---|
| 44 | end |
|---|
| 45 | end |
|---|