diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-03-04 09:53:26 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-03-04 09:53:26 +0000 |
commit | 3912c73583464e3ff203e3e101325ccabcba0506 (patch) | |
tree | 3b57620358c4c4cfe1c52702f2979876f6452aa0 /spec/controllers/admin_user_controller_spec.rb | |
parent | 2a49615ee3ea08f7952283efc0306a1ac0c23334 (diff) | |
parent | af83354da1030c2d2fad3c63f3ccb516c4923d38 (diff) |
Merge branch 'release/0.17' into wdtk
Conflicts:
config/general.yml-example
Diffstat (limited to 'spec/controllers/admin_user_controller_spec.rb')
-rw-r--r-- | spec/controllers/admin_user_controller_spec.rb | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/spec/controllers/admin_user_controller_spec.rb b/spec/controllers/admin_user_controller_spec.rb index a6e5a0d7e..99894a414 100644 --- a/spec/controllers/admin_user_controller_spec.rb +++ b/spec/controllers/admin_user_controller_spec.rb @@ -15,13 +15,32 @@ describe AdminUserController, "when administering users" do it "shows a user" do get :show, :id => users(:bob_smith_user) end - + it "logs in as another user" do get :login_as, :id => users(:bob_smith_user).id post_redirect = PostRedirect.get_last_post_redirect response.should redirect_to(:controller => 'user', :action => 'confirm', :email_token => post_redirect.email_token) end - + # See also "allows an admin to log in as another user" in spec/integration/admin_spec.rb end +describe AdminUserController, "when updating a user" do + + it "saves a change to 'can_make_batch_requests'" do + user = FactoryGirl.create(:user) + user.can_make_batch_requests?.should be_false + post :update, {:id => user.id, :admin_user => {:can_make_batch_requests => '1', + :name => user.name, + :email => user.email, + :admin_level => user.admin_level, + :ban_text => user.ban_text, + :about_me => user.about_me, + :no_limit => user.no_limit}} + flash[:notice].should == 'User successfully updated.' + response.should be_redirect + user = User.find(user.id) + user.can_make_batch_requests?.should be_true + end + +end |