Mercurial > hg > soundsoftware-site
comparison test/functional/.svn/text-base/my_controller_test.rb.svn-base @ 117:af80e5618e9b redmine-1.1
* Update to Redmine 1.1-stable branch (Redmine SVN rev 4707)
author | Chris Cannam |
---|---|
date | Thu, 13 Jan 2011 12:53:21 +0000 |
parents | 94944d00e43c |
children |
comparison
equal
deleted
inserted
replaced
39:150ceac17a8d | 117:af80e5618e9b |
---|---|
13 # | 13 # |
14 # You should have received a copy of the GNU General Public License | 14 # You should have received a copy of the GNU General Public License |
15 # along with this program; if not, write to the Free Software | 15 # along with this program; if not, write to the Free Software |
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | 17 |
18 require File.dirname(__FILE__) + '/../test_helper' | 18 require File.expand_path('../../test_helper', __FILE__) |
19 require 'my_controller' | 19 require 'my_controller' |
20 | 20 |
21 # Re-raise errors caught by the controller. | 21 # Re-raise errors caught by the controller. |
22 class MyController; def rescue_action(e) raise e end; end | 22 class MyController; def rescue_action(e) raise e end; end |
23 | 23 |
62 | 62 |
63 assert_no_tag :input, :attributes => { :name => 'user[custom_field_values][4]'} | 63 assert_no_tag :input, :attributes => { :name => 'user[custom_field_values][4]'} |
64 end | 64 end |
65 | 65 |
66 def test_update_account | 66 def test_update_account |
67 post :account, :user => {:firstname => "Joe", | 67 post :account, |
68 :login => "root", | 68 :user => { |
69 :admin => 1, | 69 :firstname => "Joe", |
70 :custom_field_values => {"4" => "0100562500"}} | 70 :login => "root", |
71 :admin => 1, | |
72 :group_ids => ['10'], | |
73 :custom_field_values => {"4" => "0100562500"} | |
74 } | |
75 | |
71 assert_redirected_to '/my/account' | 76 assert_redirected_to '/my/account' |
72 user = User.find(2) | 77 user = User.find(2) |
73 assert_equal user, assigns(:user) | 78 assert_equal user, assigns(:user) |
74 assert_equal "Joe", user.firstname | 79 assert_equal "Joe", user.firstname |
75 assert_equal "jsmith", user.login | 80 assert_equal "jsmith", user.login |
76 assert_equal "0100562500", user.custom_value_for(4).value | 81 assert_equal "0100562500", user.custom_value_for(4).value |
82 # ignored | |
77 assert !user.admin? | 83 assert !user.admin? |
84 assert user.groups.empty? | |
78 end | 85 end |
79 | 86 |
80 def test_change_password | 87 def test_change_password |
81 get :password | 88 get :password |
82 assert_response :success | 89 assert_response :success |