From e6a64aa00bea61d24c0ba0e28ecaabcca53ee09b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 23 Feb 2012 14:26:30 +0000 Subject: Adds functional tests. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8947 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/enumerations_controller_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/functional/enumerations_controller_test.rb') diff --git a/test/functional/enumerations_controller_test.rb b/test/functional/enumerations_controller_test.rb index 506fda186..ee783ab9c 100644 --- a/test/functional/enumerations_controller_test.rb +++ b/test/functional/enumerations_controller_test.rb @@ -39,6 +39,11 @@ class EnumerationsControllerTest < ActionController::TestCase assert_tag 'input', :attributes => {:name => 'enumeration[name]'} end + def test_new_with_invalid_type_should_respond_with_404 + get :new, :type => 'UnknownType' + assert_response 404 + end + def test_create assert_difference 'IssuePriority.count' do post :create, :enumeration => {:type => 'IssuePriority', :name => 'Lowest'} @@ -63,6 +68,11 @@ class EnumerationsControllerTest < ActionController::TestCase assert_tag 'input', :attributes => {:name => 'enumeration[name]', :value => 'High'} end + def test_edit_invalid_should_respond_with_404 + get :edit, :id => 999 + assert_response 404 + end + def test_update assert_no_difference 'IssuePriority.count' do put :update, :id => 6, :enumeration => {:type => 'IssuePriority', :name => 'New name'} -- cgit v1.2.3