summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-05-06 08:31:23 +0000
committerGo MAEDA <maeda@farend.jp>2018-05-06 08:31:23 +0000
commit43d9bea7c5da32a99c3ebdb828e23d6a02c31c12 (patch)
tree22b3d10ddcd3ef40d837da71245b619a71a623c2 /test
parent350a2e37827f8df6da4f3994863e9bad91b2fa98 (diff)
downloadredmine-43d9bea7c5da32a99c3ebdb828e23d6a02c31c12.tar.gz
redmine-43d9bea7c5da32a99c3ebdb828e23d6a02c31c12.zip
/users API accepts boolean strings for generate_password field (#28686).
Patch by Gregor Schmidt. git-svn-id: http://svn.redmine.org/redmine/trunk@17327 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/integration/api_test/users_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/integration/api_test/users_test.rb b/test/integration/api_test/users_test.rb
index 468caf398..192557808 100644
--- a/test/integration/api_test/users_test.rb
+++ b/test/integration/api_test/users_test.rb
@@ -152,6 +152,22 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
assert_select 'user id', :text => user.id.to_s
end
+ test "POST /users.xml with generate_password should generate password" do
+ assert_difference('User.count') do
+ post '/users.xml',
+ :params => {
+ :user => {
+ :login => 'foo', :firstname => 'Firstname', :lastname => 'Lastname',
+ :mail => 'foo@example.net', :generate_password => 'true'
+ }
+ },
+ :headers => credentials('admin')
+ end
+
+ user = User.order('id DESC').first
+ assert user.hashed_password.present?
+ end
+
test "POST /users.json with valid parameters should create the user" do
assert_difference('User.count') do
post '/users.json',