mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 20:43:19 +08:00
22 lines
390 B
Ruby
22 lines
390 B
Ruby
require 'rails_helper'
|
|
|
|
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)
|
|
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
|