discourse/spec/controllers/admin/admin_controller_spec.rb

22 lines
390 B
Ruby
Raw Normal View History

require 'rails_helper'
2013-02-06 03:16:51 +08:00
describe Admin::AdminController do
context 'index' do
it 'needs you to be logged in' do
expect do
get :index, format: :json
end.to raise_error(Discourse::NotLoggedIn)
2013-02-06 03:16:51 +08:00
end
it "raises an error if you aren't an admin" do
user = log_in
get :index, format: :json
2015-01-10 01:04:02 +08:00
expect(response).to be_forbidden
2013-02-06 03:16:51 +08:00
end
end
end