@@ -39,6 +39,11 class EnumerationsControllerTest < ActionController::TestCase | |||||
39 | assert_tag 'input', :attributes => {:name => 'enumeration[name]'} |
|
39 | assert_tag 'input', :attributes => {:name => 'enumeration[name]'} | |
40 | end |
|
40 | end | |
41 |
|
41 | |||
|
42 | def test_new_with_invalid_type_should_respond_with_404 | |||
|
43 | get :new, :type => 'UnknownType' | |||
|
44 | assert_response 404 | |||
|
45 | end | |||
|
46 | ||||
42 | def test_create |
|
47 | def test_create | |
43 | assert_difference 'IssuePriority.count' do |
|
48 | assert_difference 'IssuePriority.count' do | |
44 | post :create, :enumeration => {:type => 'IssuePriority', :name => 'Lowest'} |
|
49 | post :create, :enumeration => {:type => 'IssuePriority', :name => 'Lowest'} | |
@@ -63,6 +68,11 class EnumerationsControllerTest < ActionController::TestCase | |||||
63 | assert_tag 'input', :attributes => {:name => 'enumeration[name]', :value => 'High'} |
|
68 | assert_tag 'input', :attributes => {:name => 'enumeration[name]', :value => 'High'} | |
64 | end |
|
69 | end | |
65 |
|
70 | |||
|
71 | def test_edit_invalid_should_respond_with_404 | |||
|
72 | get :edit, :id => 999 | |||
|
73 | assert_response 404 | |||
|
74 | end | |||
|
75 | ||||
66 | def test_update |
|
76 | def test_update | |
67 | assert_no_difference 'IssuePriority.count' do |
|
77 | assert_no_difference 'IssuePriority.count' do | |
68 | put :update, :id => 6, :enumeration => {:type => 'IssuePriority', :name => 'New name'} |
|
78 | put :update, :id => 6, :enumeration => {:type => 'IssuePriority', :name => 'New name'} |
@@ -84,6 +84,11 class RolesControllerTest < ActionController::TestCase | |||||
84 | assert_equal Role.find(1), assigns(:role) |
|
84 | assert_equal Role.find(1), assigns(:role) | |
85 | end |
|
85 | end | |
86 |
|
86 | |||
|
87 | def test_edit_invalid_should_respond_with_404 | |||
|
88 | get :edit, :id => 999 | |||
|
89 | assert_response 404 | |||
|
90 | end | |||
|
91 | ||||
87 | def test_update |
|
92 | def test_update | |
88 | put :update, :id => 1, |
|
93 | put :update, :id => 1, | |
89 | :role => {:name => 'Manager', |
|
94 | :role => {:name => 'Manager', |
General Comments 0
You need to be logged in to leave comments.
Login now