summaryrefslogtreecommitdiffstats
path: root/test/functional/enumerations_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-18 21:26:30 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-07-18 21:26:30 +0000
commitec31b616982f137abdee8d0c6aa9dc4a6d103189 (patch)
treee4f5dc564be2b4ce5047a1f5acb2790fdc3b70ca /test/functional/enumerations_controller_test.rb
parent1db54e228d98d20536133bf52a8af0ce67616dc3 (diff)
downloadredmine-ec31b616982f137abdee8d0c6aa9dc4a6d103189.tar.gz
redmine-ec31b616982f137abdee8d0c6aa9dc4a6d103189.zip
Removes calls to #assert_template and #assigns in functional tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@15695 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/enumerations_controller_test.rb')
-rw-r--r--test/functional/enumerations_controller_test.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/test/functional/enumerations_controller_test.rb b/test/functional/enumerations_controller_test.rb
index 4c499e8aa..b44f3f4d1 100644
--- a/test/functional/enumerations_controller_test.rb
+++ b/test/functional/enumerations_controller_test.rb
@@ -27,7 +27,7 @@ class EnumerationsControllerTest < Redmine::ControllerTest
def test_index
get :index
assert_response :success
- assert_template 'index'
+ assert_select 'table.enumerations'
end
def test_index_should_require_admin
@@ -39,8 +39,7 @@ class EnumerationsControllerTest < Redmine::ControllerTest
def test_new
get :new, :type => 'IssuePriority'
assert_response :success
- assert_template 'new'
- assert_kind_of IssuePriority, assigns(:enumeration)
+
assert_select 'input[name=?][value=?]', 'enumeration[type]', 'IssuePriority'
assert_select 'input[name=?]', 'enumeration[name]'
end
@@ -64,13 +63,12 @@ class EnumerationsControllerTest < Redmine::ControllerTest
post :create, :enumeration => {:type => 'IssuePriority', :name => ''}
end
assert_response :success
- assert_template 'new'
+ assert_select_error /name cannot be blank/i
end
def test_edit
get :edit, :id => 6
assert_response :success
- assert_template 'edit'
assert_select 'input[name=?][value=?]', 'enumeration[name]', 'High'
end
@@ -93,7 +91,7 @@ class EnumerationsControllerTest < Redmine::ControllerTest
put :update, :id => 6, :enumeration => {:type => 'IssuePriority', :name => ''}
end
assert_response :success
- assert_template 'edit'
+ assert_select_error /name cannot be blank/i
end
def test_destroy_enumeration_not_in_use
@@ -109,7 +107,7 @@ class EnumerationsControllerTest < Redmine::ControllerTest
delete :destroy, :id => 4
end
assert_response :success
- assert_template 'destroy'
+
assert_not_nil Enumeration.find_by_id(4)
assert_select 'select[name=reassign_to_id]' do
assert_select 'option[value="6"]', :text => 'High'