source: ruby/trunk/rails/cancerehr/test/functional/people_controller_test.rb@ 60

Last change on this file since 60 was 60, checked in by KOBAYASHI, Shinji, 16 years ago

add people scaffold

File size: 1012 bytes
Line 
1require File.dirname(__FILE__) + '/../test_helper'
2
3class PeopleControllerTest < ActionController::TestCase
4 def test_should_get_index
5 get :index
6 assert_response :success
7 assert_not_nil assigns(:people)
8 end
9
10 def test_should_get_new
11 get :new
12 assert_response :success
13 end
14
15 def test_should_create_person
16 assert_difference('Person.count') do
17 post :create, :person => { }
18 end
19
20 assert_redirected_to person_path(assigns(:person))
21 end
22
23 def test_should_show_person
24 get :show, :id => people(:one).id
25 assert_response :success
26 end
27
28 def test_should_get_edit
29 get :edit, :id => people(:one).id
30 assert_response :success
31 end
32
33 def test_should_update_person
34 put :update, :id => people(:one).id, :person => { }
35 assert_redirected_to person_path(assigns(:person))
36 end
37
38 def test_should_destroy_person
39 assert_difference('Person.count', -1) do
40 delete :destroy, :id => people(:one).id
41 end
42
43 assert_redirected_to people_path
44 end
45end
Note: See TracBrowser for help on using the repository browser.