summaryrefslogtreecommitdiffstats
path: root/test/functional/issue_statuses_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-05-31 17:32:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-05-31 17:32:34 +0000
commitb834e81d7f41121fc6d9bef95ee090f8f466493e (patch)
tree61fddb6214c64e96fddd504301029bdb382ba439 /test/functional/issue_statuses_controller_test.rb
parent1d4300b674f739d671a8be22d3ea617922f16517 (diff)
downloadredmine-b834e81d7f41121fc6d9bef95ee090f8f466493e.tar.gz
redmine-b834e81d7f41121fc6d9bef95ee090f8f466493e.zip
Use Rails 5 syntax for functional tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@16585 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issue_statuses_controller_test.rb')
-rw-r--r--test/functional/issue_statuses_controller_test.rb42
1 files changed, 34 insertions, 8 deletions
diff --git a/test/functional/issue_statuses_controller_test.rb b/test/functional/issue_statuses_controller_test.rb
index 047576705..f782f8ecf 100644
--- a/test/functional/issue_statuses_controller_test.rb
+++ b/test/functional/issue_statuses_controller_test.rb
@@ -51,7 +51,11 @@ class IssueStatusesControllerTest < Redmine::ControllerTest
def test_create
assert_difference 'IssueStatus.count' do
- post :create, :issue_status => {:name => 'New status'}
+ post :create, :params => {
+ :issue_status => {
+ :name => 'New status'
+ }
+ }
end
assert_redirected_to :action => 'index'
status = IssueStatus.order('id DESC').first
@@ -59,26 +63,42 @@ class IssueStatusesControllerTest < Redmine::ControllerTest
end
def test_create_with_failure
- post :create, :issue_status => {:name => ''}
+ post :create, :params => {
+ :issue_status => {
+ :name => ''
+ }
+ }
assert_response :success
assert_select_error /name cannot be blank/i
end
def test_edit
- get :edit, :id => '3'
+ get :edit, :params => {
+ :id => '3'
+ }
assert_response :success
assert_select 'input[name=?][value=?]', 'issue_status[name]', 'Resolved'
end
def test_update
- put :update, :id => '3', :issue_status => {:name => 'Renamed status'}
+ put :update, :params => {
+ :id => '3',
+ :issue_status => {
+ :name => 'Renamed status'
+ }
+ }
assert_redirected_to :action => 'index'
status = IssueStatus.find(3)
assert_equal 'Renamed status', status.name
end
def test_update_with_failure
- put :update, :id => '3', :issue_status => {:name => ''}
+ put :update, :params => {
+ :id => '3',
+ :issue_status => {
+ :name => ''
+ }
+ }
assert_response :success
assert_select_error /name cannot be blank/i
end
@@ -88,7 +108,9 @@ class IssueStatusesControllerTest < Redmine::ControllerTest
Tracker.where(:default_status_id => 1).delete_all
assert_difference 'IssueStatus.count', -1 do
- delete :destroy, :id => '1'
+ delete :destroy, :params => {
+ :id => '1'
+ }
end
assert_redirected_to :action => 'index'
assert_nil IssueStatus.find_by_id(1)
@@ -99,7 +121,9 @@ class IssueStatusesControllerTest < Redmine::ControllerTest
Tracker.where(:default_status_id => 1).delete_all
assert_no_difference 'IssueStatus.count' do
- delete :destroy, :id => '1'
+ delete :destroy, :params => {
+ :id => '1'
+ }
end
assert_redirected_to :action => 'index'
assert_not_nil IssueStatus.find_by_id(1)
@@ -110,7 +134,9 @@ class IssueStatusesControllerTest < Redmine::ControllerTest
assert Tracker.where(:default_status_id => 1).any?
assert_no_difference 'IssueStatus.count' do
- delete :destroy, :id => '1'
+ delete :destroy, :params => {
+ :id => '1'
+ }
end
assert_redirected_to :action => 'index'
assert_not_nil IssueStatus.find_by_id(1)