mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:21:12 +08:00
Initial release of Discourse
This commit is contained in:
20
spec/controllers/admin/admin_controller_spec.rb
Normal file
20
spec/controllers/admin/admin_controller_spec.rb
Normal file
@ -0,0 +1,20 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Admin::AdminController do
|
||||
|
||||
context 'index' do
|
||||
|
||||
it 'needs you to be logged in' do
|
||||
lambda { xhr :get, :index }.should raise_error(Discourse::NotLoggedIn)
|
||||
end
|
||||
|
||||
it "raises an error if you aren't an admin" do
|
||||
user = log_in
|
||||
xhr :get, :index
|
||||
response.should be_forbidden
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
Reference in New Issue
Block a user