summaryrefslogtreecommitdiffstats
path: root/test/integration/sudo_mode_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-19 13:30:16 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2020-11-19 13:30:16 +0000
commita2894b61bf0afd79dd9d8b0e9a5cd3c9d881d25f (patch)
treee5a1634078aeb23d91e6e3411e3da71a253dc8c1 /test/integration/sudo_mode_test.rb
parenta605544acace52c688f21a92805dcee557b234b6 (diff)
downloadredmine-a2894b61bf0afd79dd9d8b0e9a5cd3c9d881d25f.tar.gz
redmine-a2894b61bf0afd79dd9d8b0e9a5cd3c9d881d25f.zip
shorten long line of test/integration/sudo_mode_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20431 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/sudo_mode_test.rb')
-rw-r--r--test/integration/sudo_mode_test.rb30
1 files changed, 27 insertions, 3 deletions
diff --git a/test/integration/sudo_mode_test.rb b/test/integration/sudo_mode_test.rb
index 500f2b824..6ddac3676 100644
--- a/test/integration/sudo_mode_test.rb
+++ b/test/integration/sudo_mode_test.rb
@@ -139,14 +139,31 @@ class SudoModeTest < Redmine::IntegrationTest
assert_select 'form[action="/roles"]'
assert_select '#flash_error', 0
- post '/roles', :params => {role: { name: 'new role', issues_visibility: 'all' }}
+ post(
+ '/roles',
+ :params => {
+ :role => {
+ :name => 'new role',
+ :issues_visibility => 'all'
+ }
+ }
+ )
assert_response :success
assert_select 'h2', 'Confirm your password to continue'
assert_select 'form[action="/roles"]'
assert_select 'input[type=hidden][name=?][value=?]', 'role[name]', 'new role'
assert_select '#flash_error', 0
- post '/roles', :params => {role: { name: 'new role', issues_visibility: 'all' }, sudo_password: 'wrong'}
+ post(
+ '/roles',
+ :params => {
+ :role => {
+ :name => 'new role',
+ :issues_visibility => 'all'
+ },
+ :sudo_password => 'wrong'
+ }
+ )
assert_response :success
assert_select 'h2', 'Confirm your password to continue'
assert_select 'form[action="/roles"]'
@@ -212,7 +229,14 @@ class SudoModeTest < Redmine::IntegrationTest
assert_equal 'newmail@test.com', User.find_by_login('jsmith').mail
# sudo mode should now be active and not require password again
- put '/my/account', :params => {user: { mail: 'even.newer.mail@test.com' }}
+ put(
+ '/my/account',
+ :params => {
+ :user => {
+ :mail => 'even.newer.mail@test.com'
+ }
+ }
+ )
assert_redirected_to '/my/account'
assert_equal 'even.newer.mail@test.com', User.find_by_login('jsmith').mail
end