discourse/spec/controllers/admin/admin_controller_spec.rb

21 lines
355 B
Ruby
Raw Normal View History

2013-02-05 14:16:51 -05:00
require 'spec_helper'
describe Admin::AdminController do
context 'index' do
it 'needs you to be logged in' do
2015-01-09 12:04:02 -05:00
expect { xhr :get, :index }.to raise_error(Discourse::NotLoggedIn)
2013-02-05 14:16:51 -05:00
end
it "raises an error if you aren't an admin" do
user = log_in
xhr :get, :index
2015-01-09 12:04:02 -05:00
expect(response).to be_forbidden
2013-02-05 14:16:51 -05:00
end
end
end