Mercurial > hg > soundsoftware-site
comparison test/integration/admin_test.rb @ 1115:433d4f72a19b redmine-2.2
Update to Redmine SVN revision 11137 on 2.2-stable branch
author | Chris Cannam |
---|---|
date | Mon, 07 Jan 2013 12:01:42 +0000 |
parents | cbb26bc654de |
children | 622f24f53b42 |
comparison
equal
deleted
inserted
replaced
929:5f33065ddc4b | 1115:433d4f72a19b |
---|---|
1 # Redmine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006-2011 Jean-Philippe Lang | 2 # Copyright (C) 2006-2012 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
7 # of the License, or (at your option) any later version. | 7 # of the License, or (at your option) any later version. |
30 def test_add_user | 30 def test_add_user |
31 log_user("admin", "admin") | 31 log_user("admin", "admin") |
32 get "/users/new" | 32 get "/users/new" |
33 assert_response :success | 33 assert_response :success |
34 assert_template "users/new" | 34 assert_template "users/new" |
35 post "/users/create", | 35 post "/users", |
36 :user => { :login => "psmith", :firstname => "Paul", | 36 :user => { :login => "psmith", :firstname => "Paul", |
37 :lastname => "Smith", :mail => "psmith@somenet.foo", | 37 :lastname => "Smith", :mail => "psmith@somenet.foo", |
38 :language => "en", :password => "psmith09", | 38 :language => "en", :password => "psmith09", |
39 :password_confirmation => "psmith09" } | 39 :password_confirmation => "psmith09" } |
40 | 40 |
51 locked_user = User.try_to_login("psmith", "psmith09") | 51 locked_user = User.try_to_login("psmith", "psmith09") |
52 assert_equal nil, locked_user | 52 assert_equal nil, locked_user |
53 end | 53 end |
54 | 54 |
55 test "Add a user as an anonymous user should fail" do | 55 test "Add a user as an anonymous user should fail" do |
56 post '/users/create', | 56 post '/users', |
57 :user => { :login => 'psmith', :firstname => 'Paul'}, | 57 :user => { :login => 'psmith', :firstname => 'Paul'}, |
58 :password => "psmith09", :password_confirmation => "psmith09" | 58 :password => "psmith09", :password_confirmation => "psmith09" |
59 assert_response :redirect | 59 assert_response :redirect |
60 assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fusers" | 60 assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fusers" |
61 end | 61 end |