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 !
3 more test passing (doing an assignment of a field without 
attr_accessible now throws an exception)


git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@3003 
567b1171-46fb-0310-a4c9-b4bef9110e78
psq (author)
Mon Oct 22 01:51:09 -0700 2007
commit  1a15d84245d1e974747e0a83d40eea9e1a64d53d
tree    bb668975f699d5cd21e614081756fed381e393ea
parent  c10f85bd617ade5e496e8ed7f1b6b650084ac788
...
40
41
42
43
 
44
45
46
...
117
118
119
120
 
121
122
123
 
124
125
126
127
128
129
 
130
131
132
 
133
134
135
...
138
139
140
141
 
142
143
144
 
145
146
147
...
40
41
42
 
43
44
45
46
...
117
118
119
 
120
121
122
 
123
124
125
126
127
128
 
129
130
131
 
132
133
134
135
...
138
139
140
 
141
142
143
 
144
145
146
147
0
@@ -40,7 +40,7 @@ class Admin::UsersControllerTest < Test::Unit::TestCase
0
     login_as :quentin
0
     assert_difference User, :count do
0
       assert_difference Membership, :count do
0
- post :create, :user => { :login => 'bob', :email => 'foo@example.com', :password => 'testy', :password_confirmation => 'testy', :admin => true }
0
+ post :create, :user => { :login => 'bob', :email => 'foo@example.com', :password => 'testy', :password_confirmation => 'testy' }
0
         assert_models_equal [sites(:first)], assigns(:user).sites
0
         assert_equal assigns(:user), User.authenticate_for(sites(:first), 'bob', 'testy')
0
         assert_redirected_to :action => 'index'
0
@@ -117,19 +117,19 @@ 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
- post :update, :id => users(:arthur).id, :user => { :admin => 'true' }
0
+ assert_raises(ActiveRecord::ProtectedAttributeAssignmentError) { 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 :success
0
+ assert_response 0
0
   end
0
 
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
- post :update, :id => users(:arthur).id, :user => { :created_at => prev_time - 1.year }
0
+ assert_raises(ActiveRecord::ProtectedAttributeAssignmentError) { 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 :success
0
+ assert_response 0
0
   end
0
 
0
   def test_should_not_permit_changing_owned_articles_in_update
0
@@ -138,10 +138,10 @@ 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
- post :update, :id => user.id, :user => { :article_ids => prev_article_ids[0..1] }
0
+ assert_raises(ActiveRecord::ProtectedAttributeAssignmentError) { 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 :success
0
+ assert_response 0
0
   end
0
 
0
   def test_should_show_deleted_users

Comments

    No one has commented yet.