aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/admin_public_body_controller_spec.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-06-27 14:15:09 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-06-27 14:15:09 +0100
commitaf24b1e306dab3ebe10d97f7777abedd011321da (patch)
treeb440b839bf1e7465ab154cdc19ee9366b9f98198 /spec/controllers/admin_public_body_controller_spec.rb
parent6c4c822ef7a4491bf821326af779e5be9118c0a1 (diff)
parent5b80d1b9a0933b1e20de013d1aa8b8522f2ad066 (diff)
Merge branch 'release/0.6.1'0.6.1
Diffstat (limited to 'spec/controllers/admin_public_body_controller_spec.rb')
-rw-r--r--spec/controllers/admin_public_body_controller_spec.rb10
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