mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
fix source indent of test/integration/sudo_mode_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20352 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -17,12 +17,17 @@ class SudoModeTest < Redmine::IntegrationTest
|
|||||||
log_user("admin", "admin")
|
log_user("admin", "admin")
|
||||||
get "/users/new"
|
get "/users/new"
|
||||||
assert_response :success
|
assert_response :success
|
||||||
post "/users", :params => {
|
post(
|
||||||
:user => { :login => "psmith", :firstname => "Paul",
|
"/users",
|
||||||
:lastname => "Smith", :mail => "psmith@somenet.foo",
|
:params => {
|
||||||
:language => "en", :password => "psmith09",
|
:user => {
|
||||||
:password_confirmation => "psmith09" }
|
:login => "psmith", :firstname => "Paul",
|
||||||
|
:lastname => "Smith", :mail => "psmith@somenet.foo",
|
||||||
|
:language => "en", :password => "psmith09",
|
||||||
|
:password_confirmation => "psmith09"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
)
|
||||||
assert_response 302
|
assert_response 302
|
||||||
|
|
||||||
user = User.find_by_login("psmith")
|
user = User.find_by_login("psmith")
|
||||||
@@ -34,25 +39,35 @@ class SudoModeTest < Redmine::IntegrationTest
|
|||||||
expire_sudo_mode!
|
expire_sudo_mode!
|
||||||
get "/users/new"
|
get "/users/new"
|
||||||
assert_response :success
|
assert_response :success
|
||||||
post "/users", :params => {
|
post(
|
||||||
:user => { :login => "psmith", :firstname => "Paul",
|
"/users",
|
||||||
:lastname => "Smith", :mail => "psmith@somenet.foo",
|
:params => {
|
||||||
:language => "en", :password => "psmith09",
|
:user => {
|
||||||
:password_confirmation => "psmith09" }
|
:login => "psmith", :firstname => "Paul",
|
||||||
|
:lastname => "Smith", :mail => "psmith@somenet.foo",
|
||||||
|
:language => "en", :password => "psmith09",
|
||||||
|
:password_confirmation => "psmith09"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
)
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_nil User.find_by_login("psmith")
|
assert_nil User.find_by_login("psmith")
|
||||||
|
|
||||||
assert_select 'input[name=?][value=?]', 'user[login]', 'psmith'
|
assert_select 'input[name=?][value=?]', 'user[login]', 'psmith'
|
||||||
assert_select 'input[name=?][value=?]', 'user[firstname]', 'Paul'
|
assert_select 'input[name=?][value=?]', 'user[firstname]', 'Paul'
|
||||||
|
|
||||||
post "/users", :params => {
|
post(
|
||||||
:user => { :login => "psmith", :firstname => "Paul",
|
"/users",
|
||||||
:lastname => "Smith", :mail => "psmith@somenet.foo",
|
:params => {
|
||||||
:language => "en", :password => "psmith09",
|
:user => {
|
||||||
:password_confirmation => "psmith09" },
|
:login => "psmith", :firstname => "Paul",
|
||||||
:sudo_password => 'admin'
|
:lastname => "Smith", :mail => "psmith@somenet.foo",
|
||||||
|
:language => "en", :password => "psmith09",
|
||||||
|
:password_confirmation => "psmith09"
|
||||||
|
},
|
||||||
|
:sudo_password => 'admin'
|
||||||
}
|
}
|
||||||
|
)
|
||||||
assert_response 302
|
assert_response 302
|
||||||
|
|
||||||
user = User.find_by_login("psmith")
|
user = User.find_by_login("psmith")
|
||||||
@@ -178,15 +193,18 @@ class SudoModeTest < Redmine::IntegrationTest
|
|||||||
def test_sudo_mode_should_skip_api_requests
|
def test_sudo_mode_should_skip_api_requests
|
||||||
with_settings :rest_api_enabled => '1' do
|
with_settings :rest_api_enabled => '1' do
|
||||||
assert_difference('User.count') do
|
assert_difference('User.count') do
|
||||||
post '/users.json', :params => {
|
post(
|
||||||
|
'/users.json',
|
||||||
|
:params => {
|
||||||
:user => {
|
:user => {
|
||||||
:login => 'foo', :firstname => 'Firstname', :lastname => 'Lastname',
|
:login => 'foo', :firstname => 'Firstname',
|
||||||
|
:lastname => 'Lastname',
|
||||||
:mail => 'foo@example.net', :password => 'secret123',
|
:mail => 'foo@example.net', :password => 'secret123',
|
||||||
:mail_notification => 'only_assigned'
|
:mail_notification => 'only_assigned'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
:headers => credentials('admin')
|
:headers => credentials('admin')
|
||||||
|
)
|
||||||
assert_response :created
|
assert_response :created
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user