2016-01-26 11:03:38 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2016-02-17 16:20:09 -05:00
|
|
|
describe API::Runners, api: true do
|
2016-01-26 11:03:38 -05:00
|
|
|
include ApiHelpers
|
|
|
|
|
|
|
|
let(:admin) { create(:user, :admin) }
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:user2) { create(:user) }
|
2016-02-17 08:53:48 -05:00
|
|
|
|
|
|
|
let(:project) { create(:project, creator_id: user.id) }
|
|
|
|
let(:project2) { create(:project, creator_id: user.id) }
|
|
|
|
|
2016-02-17 16:20:09 -05:00
|
|
|
let!(:shared_runner) { create(:ci_runner, :shared) }
|
|
|
|
let!(:unused_specific_runner) { create(:ci_runner) }
|
2016-02-17 08:53:48 -05:00
|
|
|
|
|
|
|
let!(:specific_runner) do
|
2016-02-17 16:20:09 -05:00
|
|
|
create(:ci_runner).tap do |runner|
|
|
|
|
create(:ci_runner_project, runner: runner, project: project)
|
|
|
|
end
|
2016-02-17 08:53:48 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
let!(:two_projects_runner) do
|
2016-02-17 16:20:09 -05:00
|
|
|
create(:ci_runner).tap do |runner|
|
|
|
|
create(:ci_runner_project, runner: runner, project: project)
|
|
|
|
create(:ci_runner_project, runner: runner, project: project2)
|
|
|
|
end
|
2016-02-17 08:53:48 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
before do
|
|
|
|
# Set project access for users
|
2016-03-06 16:53:22 -05:00
|
|
|
create(:project_member, :master, user: user, project: project)
|
|
|
|
create(:project_member, :master, user: user, project: project2)
|
|
|
|
create(:project_member, :reporter, user: user2, project: project)
|
2016-02-17 08:53:48 -05:00
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
|
|
|
|
describe 'GET /runners' do
|
2016-01-29 10:44:29 -05:00
|
|
|
context 'authorized user' do
|
2016-02-02 09:52:02 -05:00
|
|
|
it 'should return user available runners' do
|
|
|
|
get api('/runners', user)
|
2016-02-17 09:27:28 -05:00
|
|
|
shared = json_response.any?{ |r| r['is_shared'] }
|
2016-02-02 09:52:02 -05:00
|
|
|
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
expect(json_response).to be_an Array
|
|
|
|
expect(shared).to be_falsey
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should filter runners by scope' do
|
2016-02-05 09:35:21 -05:00
|
|
|
get api('/runners?scope=active', user)
|
2016-02-17 09:27:28 -05:00
|
|
|
shared = json_response.any?{ |r| r['is_shared'] }
|
2016-02-02 09:52:02 -05:00
|
|
|
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
expect(json_response).to be_an Array
|
|
|
|
expect(shared).to be_falsey
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should avoid filtering if scope is invalid' do
|
|
|
|
get api('/runners?scope=unknown', user)
|
|
|
|
expect(response.status).to eq(400)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'unauthorized user' do
|
|
|
|
it 'should not return runners' do
|
|
|
|
get api('/runners')
|
|
|
|
|
|
|
|
expect(response.status).to eq(401)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'GET /runners/all' do
|
|
|
|
context 'authorized user' do
|
|
|
|
context 'with admin privileges' do
|
2016-01-29 10:44:29 -05:00
|
|
|
it 'should return all runners' do
|
2016-02-02 09:52:02 -05:00
|
|
|
get api('/runners/all', admin)
|
2016-02-17 09:27:28 -05:00
|
|
|
shared = json_response.any?{ |r| r['is_shared'] }
|
2016-01-29 10:44:29 -05:00
|
|
|
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
expect(json_response).to be_an Array
|
|
|
|
expect(shared).to be_truthy
|
|
|
|
end
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-02 09:52:02 -05:00
|
|
|
context 'without admin privileges' do
|
|
|
|
it 'should not return runners list' do
|
|
|
|
get api('/runners/all', user)
|
2016-01-29 10:44:29 -05:00
|
|
|
|
2016-02-02 09:52:02 -05:00
|
|
|
expect(response.status).to eq(403)
|
2016-01-29 10:44:29 -05:00
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should filter runners by scope' do
|
2016-02-05 09:35:21 -05:00
|
|
|
get api('/runners/all?scope=specific', admin)
|
2016-02-17 09:27:28 -05:00
|
|
|
shared = json_response.any?{ |r| r['is_shared'] }
|
2016-01-26 11:03:38 -05:00
|
|
|
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
expect(json_response).to be_an Array
|
|
|
|
expect(shared).to be_falsey
|
|
|
|
end
|
|
|
|
|
2016-01-29 10:44:29 -05:00
|
|
|
it 'should avoid filtering if scope is invalid' do
|
2016-02-02 09:52:02 -05:00
|
|
|
get api('/runners?scope=unknown', admin)
|
2016-01-29 10:44:29 -05:00
|
|
|
expect(response.status).to eq(400)
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'unauthorized user' do
|
|
|
|
it 'should not return runners' do
|
|
|
|
get api('/runners')
|
|
|
|
|
|
|
|
expect(response.status).to eq(401)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'GET /runners/:id' do
|
|
|
|
context 'admin user' do
|
2016-02-15 06:55:41 -05:00
|
|
|
context 'when runner is shared' do
|
|
|
|
it "should return runner's details" do
|
|
|
|
get api("/runners/#{shared_runner.id}", admin)
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
expect(response.status).to eq(200)
|
|
|
|
expect(json_response['description']).to eq(shared_runner.description)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
context 'when runner is not shared' do
|
|
|
|
it "should return runner's details" do
|
|
|
|
get api("/runners/#{specific_runner.id}", admin)
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
expect(response.status).to eq(200)
|
|
|
|
expect(json_response['description']).to eq(specific_runner.description)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should return 404 if runner does not exists' do
|
|
|
|
get api('/runners/9999', admin)
|
|
|
|
|
|
|
|
expect(response.status).to eq(404)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "runner project's administrative user" do
|
2016-02-15 06:55:41 -05:00
|
|
|
context 'when runner is not shared' do
|
|
|
|
it "should return runner's details" do
|
|
|
|
get api("/runners/#{specific_runner.id}", user)
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
expect(response.status).to eq(200)
|
|
|
|
expect(json_response['description']).to eq(specific_runner.description)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
context 'when runner is shared' do
|
|
|
|
it "should return runner's details" do
|
|
|
|
get api("/runners/#{shared_runner.id}", user)
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
expect(response.status).to eq(200)
|
|
|
|
expect(json_response['description']).to eq(shared_runner.description)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'other authorized user' do
|
|
|
|
it "should not return runner's details" do
|
|
|
|
get api("/runners/#{specific_runner.id}", user2)
|
|
|
|
|
|
|
|
expect(response.status).to eq(403)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'unauthorized user' do
|
|
|
|
it "should not return runner's details" do
|
|
|
|
get api("/runners/#{specific_runner.id}")
|
|
|
|
|
|
|
|
expect(response.status).to eq(401)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'PUT /runners/:id' do
|
|
|
|
context 'admin user' do
|
2016-02-15 06:55:41 -05:00
|
|
|
context 'when runner is shared' do
|
|
|
|
it 'should update runner' do
|
|
|
|
description = shared_runner.description
|
|
|
|
active = shared_runner.active
|
2016-02-17 09:36:14 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
put api("/runners/#{shared_runner.id}", admin), description: "#{description}_updated", active: !active,
|
|
|
|
tag_list: ['ruby2.1', 'pgsql', 'mysql']
|
|
|
|
shared_runner.reload
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
expect(response.status).to eq(200)
|
2016-02-17 09:36:14 -05:00
|
|
|
expect(shared_runner.description).to eq("#{description}_updated")
|
|
|
|
expect(shared_runner.active).to eq(!active)
|
|
|
|
expect(shared_runner.tag_list).to include('ruby2.1', 'pgsql', 'mysql')
|
2016-02-15 06:55:41 -05:00
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
context 'when runner is not shared' do
|
|
|
|
it 'should update runner' do
|
|
|
|
description = specific_runner.description
|
|
|
|
put api("/runners/#{specific_runner.id}", admin), description: 'test'
|
|
|
|
specific_runner.reload
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
expect(response.status).to eq(200)
|
|
|
|
expect(specific_runner.description).to eq('test')
|
|
|
|
expect(specific_runner.description).not_to eq(description)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should return 404 if runner does not exists' do
|
|
|
|
put api('/runners/9999', admin), description: 'test'
|
|
|
|
|
|
|
|
expect(response.status).to eq(404)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'authorized user' do
|
2016-02-15 06:55:41 -05:00
|
|
|
context 'when runner is shared' do
|
|
|
|
it 'should not update runner' do
|
2016-02-17 09:48:58 -05:00
|
|
|
put api("/runners/#{shared_runner.id}", user)
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
expect(response.status).to eq(403)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
context 'when runner is not shared' do
|
|
|
|
it 'should not update runner without access to it' do
|
2016-02-17 09:48:58 -05:00
|
|
|
put api("/runners/#{specific_runner.id}", user2)
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
expect(response.status).to eq(403)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
it 'should update runner with access to it' do
|
|
|
|
description = specific_runner.description
|
|
|
|
put api("/runners/#{specific_runner.id}", admin), description: 'test'
|
|
|
|
specific_runner.reload
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
expect(response.status).to eq(200)
|
|
|
|
expect(specific_runner.description).to eq('test')
|
|
|
|
expect(specific_runner.description).not_to eq(description)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'unauthorized user' do
|
|
|
|
it 'should not delete runner' do
|
2016-02-17 09:48:58 -05:00
|
|
|
put api("/runners/#{specific_runner.id}")
|
2016-01-26 11:03:38 -05:00
|
|
|
|
|
|
|
expect(response.status).to eq(401)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'DELETE /runners/:id' do
|
|
|
|
context 'admin user' do
|
2016-02-15 06:55:41 -05:00
|
|
|
context 'when runner is shared' do
|
|
|
|
it 'should delete runner' do
|
|
|
|
expect do
|
|
|
|
delete api("/runners/#{shared_runner.id}", admin)
|
|
|
|
end.to change{ Ci::Runner.shared.count }.by(-1)
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
context 'when runner is not shared' do
|
|
|
|
it 'should delete unused runner' do
|
|
|
|
expect do
|
|
|
|
delete api("/runners/#{unused_specific_runner.id}", admin)
|
|
|
|
end.to change{ Ci::Runner.specific.count }.by(-1)
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
it 'should delete used runner' do
|
|
|
|
expect do
|
|
|
|
delete api("/runners/#{specific_runner.id}", admin)
|
|
|
|
end.to change{ Ci::Runner.specific.count }.by(-1)
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should return 404 if runner does not exists' do
|
|
|
|
delete api('/runners/9999', admin)
|
|
|
|
|
|
|
|
expect(response.status).to eq(404)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'authorized user' do
|
2016-02-15 06:55:41 -05:00
|
|
|
context 'when runner is shared' do
|
|
|
|
it 'should not delete runner' do
|
|
|
|
delete api("/runners/#{shared_runner.id}", user)
|
|
|
|
expect(response.status).to eq(403)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
context 'when runner is not shared' do
|
|
|
|
it 'should not delete runner without access to it' do
|
|
|
|
delete api("/runners/#{specific_runner.id}", user2)
|
|
|
|
expect(response.status).to eq(403)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
it 'should not delete runner with more than one associated project' do
|
|
|
|
delete api("/runners/#{two_projects_runner.id}", user)
|
|
|
|
expect(response.status).to eq(403)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
|
2016-02-15 06:55:41 -05:00
|
|
|
it 'should delete runner for one owned project' do
|
|
|
|
expect do
|
|
|
|
delete api("/runners/#{specific_runner.id}", user)
|
|
|
|
end.to change{ Ci::Runner.specific.count }.by(-1)
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'unauthorized user' do
|
|
|
|
it 'should not delete runner' do
|
|
|
|
delete api("/runners/#{specific_runner.id}")
|
|
|
|
|
|
|
|
expect(response.status).to eq(401)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'GET /projects/:id/runners' do
|
|
|
|
context 'authorized user with master privileges' do
|
|
|
|
it "should return project's runners" do
|
|
|
|
get api("/projects/#{project.id}/runners", user)
|
2016-02-17 09:27:28 -05:00
|
|
|
shared = json_response.any?{ |r| r['is_shared'] }
|
2016-01-26 11:03:38 -05:00
|
|
|
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
expect(json_response).to be_an Array
|
|
|
|
expect(shared).to be_truthy
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'authorized user without master privileges' do
|
|
|
|
it "should not return project's runners" do
|
|
|
|
get api("/projects/#{project.id}/runners", user2)
|
|
|
|
|
|
|
|
expect(response.status).to eq(403)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'unauthorized user' do
|
|
|
|
it "should not return project's runners" do
|
|
|
|
get api("/projects/#{project.id}/runners")
|
|
|
|
|
|
|
|
expect(response.status).to eq(401)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2016-01-29 09:40:25 -05:00
|
|
|
|
2016-02-16 06:05:48 -05:00
|
|
|
describe 'POST /projects/:id/runners' do
|
2016-01-29 09:40:25 -05:00
|
|
|
context 'authorized user' do
|
|
|
|
it 'should enable specific runner' do
|
2016-02-17 16:20:09 -05:00
|
|
|
specific_runner2 = create(:ci_runner).tap do |runner|
|
|
|
|
create(:ci_runner_project, runner: runner, project: project2)
|
|
|
|
end
|
|
|
|
|
2016-01-29 09:40:25 -05:00
|
|
|
expect do
|
2016-02-16 06:05:48 -05:00
|
|
|
post api("/projects/#{project.id}/runners", user), runner_id: specific_runner2.id
|
2016-01-29 09:40:25 -05:00
|
|
|
end.to change{ project.runners.count }.by(+1)
|
2016-02-02 10:31:52 -05:00
|
|
|
expect(response.status).to eq(201)
|
2016-01-29 09:40:25 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should avoid changes when enabling already enabled runner' do
|
|
|
|
expect do
|
2016-02-16 06:05:48 -05:00
|
|
|
post api("/projects/#{project.id}/runners", user), runner_id: specific_runner.id
|
2016-01-29 09:40:25 -05:00
|
|
|
end.to change{ project.runners.count }.by(0)
|
2016-02-02 10:31:52 -05:00
|
|
|
expect(response.status).to eq(201)
|
2016-01-29 09:40:25 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'should not enable shared runner' do
|
2016-02-16 06:05:48 -05:00
|
|
|
post api("/projects/#{project.id}/runners", user), runner_id: shared_runner.id
|
2016-01-29 09:40:25 -05:00
|
|
|
|
|
|
|
expect(response.status).to eq(403)
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'user is admin' do
|
|
|
|
it 'should enable any specific runner' do
|
|
|
|
expect do
|
2016-02-16 06:05:48 -05:00
|
|
|
post api("/projects/#{project.id}/runners", admin), runner_id: unused_specific_runner.id
|
2016-01-29 09:40:25 -05:00
|
|
|
end.to change{ project.runners.count }.by(+1)
|
2016-02-02 10:31:52 -05:00
|
|
|
expect(response.status).to eq(201)
|
2016-01-29 09:40:25 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'user is not admin' do
|
|
|
|
it 'should not enable runner without access to' do
|
2016-02-16 06:05:48 -05:00
|
|
|
post api("/projects/#{project.id}/runners", user), runner_id: unused_specific_runner.id
|
2016-01-29 09:40:25 -05:00
|
|
|
|
|
|
|
expect(response.status).to eq(403)
|
|
|
|
end
|
|
|
|
end
|
2016-02-16 06:05:48 -05:00
|
|
|
|
|
|
|
it 'should raise an error when no runner_id param is provided' do
|
|
|
|
post api("/projects/#{project.id}/runners", admin)
|
|
|
|
|
|
|
|
expect(response.status).to eq(400)
|
|
|
|
end
|
2016-01-29 09:40:25 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'authorized user without permissions' do
|
|
|
|
it 'should not enable runner' do
|
2016-02-17 09:48:58 -05:00
|
|
|
post api("/projects/#{project.id}/runners", user2)
|
2016-01-29 09:40:25 -05:00
|
|
|
|
|
|
|
expect(response.status).to eq(403)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'unauthorized user' do
|
|
|
|
it 'should not enable runner' do
|
2016-02-17 09:48:58 -05:00
|
|
|
post api("/projects/#{project.id}/runners")
|
2016-01-29 09:40:25 -05:00
|
|
|
|
|
|
|
expect(response.status).to eq(401)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'DELETE /projects/:id/runners/:runner_id' do
|
|
|
|
context 'authorized user' do
|
|
|
|
context 'when runner have more than one associated projects' do
|
|
|
|
it "should disable project's runner" do
|
|
|
|
expect do
|
|
|
|
delete api("/projects/#{project.id}/runners/#{two_projects_runner.id}", user)
|
|
|
|
end.to change{ project.runners.count }.by(-1)
|
|
|
|
expect(response.status).to eq(200)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when runner have one associated projects' do
|
|
|
|
it "should not disable project's runner" do
|
|
|
|
expect do
|
|
|
|
delete api("/projects/#{project.id}/runners/#{specific_runner.id}", user)
|
|
|
|
end.to change{ project.runners.count }.by(0)
|
|
|
|
expect(response.status).to eq(403)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should return 404 is runner is not found' do
|
|
|
|
delete api("/projects/#{project.id}/runners/9999", user)
|
|
|
|
|
|
|
|
expect(response.status).to eq(404)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'authorized user without permissions' do
|
|
|
|
it "should not disable project's runner" do
|
|
|
|
delete api("/projects/#{project.id}/runners/#{specific_runner.id}", user2)
|
|
|
|
|
|
|
|
expect(response.status).to eq(403)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'unauthorized user' do
|
|
|
|
it "should not disable project's runner" do
|
|
|
|
delete api("/projects/#{project.id}/runners/#{specific_runner.id}")
|
|
|
|
|
|
|
|
expect(response.status).to eq(401)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2016-01-26 11:03:38 -05:00
|
|
|
end
|