Commit 77456854 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Added specs for Geo Refresh Projects API endpoint

parent fde54e2c
require 'spec_helper'
describe API::API, api: true do
include ApiHelpers
let(:admin) { create(:admin) }
let(:user) { create(:user) }
describe 'POST /geo/refresh_projects' do
before(:each) { allow_any_instance_of(::Geo::ScheduleRepoUpdateService).to receive(:execute) }
it 'should retrieve the license information if admin is logged in' do
post api('/geo/refresh_projects', admin), projects: ['1', '2', '3']
expect(response.status).to eq 201
end
it 'should deny access if not admin' do
post api('/geo/refresh_projects', user)
expect(response.status).to eq 403
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment