mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 15:35:12 +08:00
49ed382c2a
This also handles a general case where exceptions leak out prior to being handled by the application controller
21 lines
365 B
Ruby
21 lines
365 B
Ruby
require 'rails_helper'
|
|
|
|
describe Admin::AdminController do
|
|
|
|
context 'index' do
|
|
|
|
it 'needs you to be logged in' do
|
|
get :index, format: :json
|
|
expect(response.status).to eq(403)
|
|
end
|
|
|
|
it "raises an error if you aren't an admin" do
|
|
_user = log_in
|
|
get :index, format: :json
|
|
expect(response).to be_forbidden
|
|
end
|
|
|
|
end
|
|
|
|
end
|