public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
remove ProtectedAttributeAssignmentError

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@3046 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Fri Nov 23 16:15:32 -0800 2007
commit  28b38e25ee171cd033d7b893339d28675941021a
tree    af55245999d64a44bafeed4be60821673de789aa
parent  3be94fd06016b3471a659b0dba9ff7d7bb431011
...
117
118
119
120
 
121
122
123
...
126
127
128
129
 
130
131
132
...
138
139
140
141
 
142
143
144
...
117
118
119
 
120
121
122
123
...
126
127
128
 
129
130
131
132
...
138
139
140
 
141
142
143
144
0
@@ -117,7 +117,7 @@ class Admin::UsersControllerTest < Test::Unit::TestCase
0
   def test_should_not_permit_promoting_self_to_admin_in_update
0
     login_as :arthur, :hostess
0
     assert !users(:arthur).admin, "we mean to test with a non-admin user"
0
- assert_raises(ActiveRecord::ProtectedAttributeAssignmentError) { post :update, :id => users(:arthur).id, :user => { :admin => 'true' } }
0
+ post :update, :id => users(:arthur).id, :user => { :admin => 'true' }
0
     users(:arthur).reload
0
     assert !users(:arthur).admin, "user.admin shouldn't change"
0
     assert_response 0
0
@@ -126,7 +126,7 @@ class Admin::UsersControllerTest < Test::Unit::TestCase
0
   def test_should_not_permit_changing_own_created_at_in_update
0
     login_as :arthur, :hostess
0
     prev_time = users(:arthur).created_at
0
- assert_raises(ActiveRecord::ProtectedAttributeAssignmentError) { post :update, :id => users(:arthur).id, :user => { :created_at => prev_time - 1.year } }
0
+ post :update, :id => users(:arthur).id, :user => { :created_at => prev_time - 1.year }
0
     users(:arthur).reload
0
     assert_equal prev_time, users(:arthur).created_at, "user.created_at shouldn't change"
0
     assert_response 0
0
@@ -138,7 +138,7 @@ class Admin::UsersControllerTest < Test::Unit::TestCase
0
     prev_article_ids = user.article_ids
0
     assert prev_article_ids.size > 2, "Test needs more than 2 articles. Pick another user?"
0
     #but now we're going to try to own only the first 2 of them...
0
- assert_raises(ActiveRecord::ProtectedAttributeAssignmentError) { post :update, :id => user.id, :user => { :article_ids => prev_article_ids[0..1] }}
0
+ post :update, :id => user.id, :user => { :article_ids => prev_article_ids[0..1] }
0
     user.reload
0
     assert_equal prev_article_ids, user.article_ids, "user.article_ids[] shouldn't change"
0
     assert_response 0

Comments

    No one has commented yet.