2019-04-29 20:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-23 23:01:11 -04:00
|
|
|
RSpec.describe Admin::AdminController do
|
2018-06-11 00:32:55 -04:00
|
|
|
describe '#index' do
|
|
|
|
it "needs you to be logged in" do
|
|
|
|
get "/admin.json"
|
|
|
|
expect(response.status).to eq(404)
|
|
|
|
end
|
2018-01-31 20:26:45 -05:00
|
|
|
|
2018-06-11 00:32:55 -04:00
|
|
|
it "should return the right response if user isn't a staff" do
|
|
|
|
sign_in(Fabricate(:user))
|
|
|
|
get "/admin", params: { api_key: 'asdiasiduga' }
|
|
|
|
expect(response.status).to eq(404)
|
|
|
|
|
|
|
|
get "/admin"
|
|
|
|
expect(response.status).to eq(404)
|
|
|
|
end
|
2017-08-10 05:27:01 -04:00
|
|
|
end
|
|
|
|
end
|