From d6f389658b9e83d7a5d74c57fc46a203a5a88591 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 19 Jun 2015 18:41:10 +0000 Subject: Require password re-entry for sensitive actions (#19851). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@14333 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/integration/admin_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/integration/admin_test.rb') diff --git a/test/integration/admin_test.rb b/test/integration/admin_test.rb index 402d0ed3a..ef95cc9df 100644 --- a/test/integration/admin_test.rb +++ b/test/integration/admin_test.rb @@ -26,6 +26,14 @@ class AdminTest < Redmine::IntegrationTest :members, :enabled_modules + def setup + Redmine::SudoMode.enable! + end + + def teardown + Redmine::SudoMode.disable! + end + def test_add_user log_user("admin", "admin") get "/users/new" @@ -36,6 +44,15 @@ class AdminTest < Redmine::IntegrationTest :lastname => "Smith", :mail => "psmith@somenet.foo", :language => "en", :password => "psmith09", :password_confirmation => "psmith09" } + assert_response :success + assert_nil User.find_by_login("psmith") + + post "/users", + :user => { :login => "psmith", :firstname => "Paul", + :lastname => "Smith", :mail => "psmith@somenet.foo", + :language => "en", :password => "psmith09", + :password_confirmation => "psmith09" }, + :sudo_password => 'admin' user = User.find_by_login("psmith") assert_kind_of User, user -- cgit v1.2.3