2015-10-11 05:41:23 -04:00
|
|
|
require 'rails_helper'
|
2013-02-05 14:16:51 -05:00
|
|
|
|
|
|
|
describe Admin::AdminController do
|
|
|
|
|
|
|
|
context 'index' do
|
|
|
|
|
|
|
|
it 'needs you to be logged in' do
|
2018-01-11 22:15:10 -05:00
|
|
|
get :index, format: :json
|
|
|
|
expect(response.status).to eq(403)
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it "raises an error if you aren't an admin" do
|
2018-01-11 22:15:10 -05:00
|
|
|
_user = log_in
|
2017-08-31 00:06:56 -04:00
|
|
|
get :index, format: :json
|
2015-01-09 12:04:02 -05:00
|
|
|
expect(response).to be_forbidden
|
2013-02-05 14:16:51 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|