gitlab-org--gitlab-foss/spec/controllers/admin/groups_controller_spec.rb
2017-01-25 17:14:38 -05:00

25 lines
621 B
Ruby

require 'spec_helper'
describe Admin::GroupsController do
let(:group) { create(:group) }
let(:project) { create(:empty_project, namespace: group) }
let(:admin) { create(:admin) }
before do
sign_in(admin)
end
describe 'DELETE #destroy' do
it 'schedules a group destroy' do
Sidekiq::Testing.fake! do
expect { delete :destroy, id: project.group.path }.to change(GroupDestroyWorker.jobs, :size).by(1)
end
end
it 'redirects to the admin group path' do
delete :destroy, id: project.group.path
expect(response).to redirect_to(admin_groups_path)
end
end
end