diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-07-02 13:09:06 +0100 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-07-02 13:09:06 +0100 |
commit | de929cfe8c0f297c9945189f1456bba3908498a1 (patch) | |
tree | b8ddd5f1875723bda896c66084bc438fe6b8c088 /spec/controllers/admin_public_body_controller_spec.rb | |
parent | 84a27578e5e82739e3a6826c5d2d9890edd600a4 (diff) | |
parent | a9f1d84e7810936f7917c8a367b4713ea77554c9 (diff) |
Merge branch 'master' into wdtk
Diffstat (limited to 'spec/controllers/admin_public_body_controller_spec.rb')
-rw-r--r-- | spec/controllers/admin_public_body_controller_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/controllers/admin_public_body_controller_spec.rb b/spec/controllers/admin_public_body_controller_spec.rb index 171cb21b5..55a6649b2 100644 --- a/spec/controllers/admin_public_body_controller_spec.rb +++ b/spec/controllers/admin_public_body_controller_spec.rb @@ -146,7 +146,15 @@ describe AdminPublicBodyController, "when administering public bodies and paying session[:using_admin].should == 1 end - + it "doesn't allow non-superusers to do stuff" do + session[:user_id] = users(:robin_user).id + @request.env["HTTP_AUTHORIZATION"] = "" + n = PublicBody.count + post :destroy, { :id => public_bodies(:forlorn_public_body).id } + response.should redirect_to(:controller=>'user', :action=>'signin', :token=>PostRedirect.get_last_post_redirect.token) + PublicBody.count.should == n + session[:using_admin].should == nil + end end describe AdminPublicBodyController, "when administering public bodies with i18n" do |