@@ -39,6 +39,11 class EnumerationsControllerTest < ActionController::TestCase | |||
|
39 | 39 | assert_tag 'input', :attributes => {:name => 'enumeration[name]'} |
|
40 | 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 | 47 | def test_create |
|
43 | 48 | assert_difference 'IssuePriority.count' do |
|
44 | 49 | post :create, :enumeration => {:type => 'IssuePriority', :name => 'Lowest'} |
@@ -63,6 +68,11 class EnumerationsControllerTest < ActionController::TestCase | |||
|
63 | 68 | assert_tag 'input', :attributes => {:name => 'enumeration[name]', :value => 'High'} |
|
64 | 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 | 76 | def test_update |
|
67 | 77 | assert_no_difference 'IssuePriority.count' do |
|
68 | 78 | put :update, :id => 6, :enumeration => {:type => 'IssuePriority', :name => 'New name'} |
@@ -84,6 +84,11 class RolesControllerTest < ActionController::TestCase | |||
|
84 | 84 | assert_equal Role.find(1), assigns(:role) |
|
85 | 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 | 92 | def test_update |
|
88 | 93 | put :update, :id => 1, |
|
89 | 94 | :role => {:name => 'Manager', |
General Comments 0
You need to be logged in to leave comments.
Login now