diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-02-02 16:31:52 +0100 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2016-02-19 13:18:47 +0100 |
commit | 16b3368af32084b19436012170dd461e12cf028a (patch) | |
tree | cc3ade19da7bc27c445d0d656ff772b4a3ef4ebd /spec/requests | |
parent | 81ced6f55b1ab847bbb21da9c43410340c95c2b3 (diff) | |
download | gitlab-ce-16b3368af32084b19436012170dd461e12cf028a.tar.gz |
Fix runners API spec
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/runners_spec.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/requests/api/runners_spec.rb b/spec/requests/api/runners_spec.rb index a3c96777b92..27ce8c08eb3 100644 --- a/spec/requests/api/runners_spec.rb +++ b/spec/requests/api/runners_spec.rb @@ -316,24 +316,24 @@ describe API::API, api: true do end end - describe 'PUT /projects/:id/runners/:runner_id' do + describe 'POST /projects/:id/runners/:runner_id' do context 'authorized user' do it 'should enable specific runner' do expect do - put api("/projects/#{project.id}/runners/#{specific_runner2.id}", user) + post api("/projects/#{project.id}/runners/#{specific_runner2.id}", user) end.to change{ project.runners.count }.by(+1) - expect(response.status).to eq(200) + expect(response.status).to eq(201) end it 'should avoid changes when enabling already enabled runner' do expect do - put api("/projects/#{project.id}/runners/#{specific_runner.id}", user) + post api("/projects/#{project.id}/runners/#{specific_runner.id}", user) end.to change{ project.runners.count }.by(0) - expect(response.status).to eq(200) + expect(response.status).to eq(201) end it 'should not enable shared runner' do - put api("/projects/#{project.id}/runners/#{shared_runner.id}", user) + post api("/projects/#{project.id}/runners/#{shared_runner.id}", user) expect(response.status).to eq(403) end @@ -341,15 +341,15 @@ describe API::API, api: true do context 'user is admin' do it 'should enable any specific runner' do expect do - put api("/projects/#{project.id}/runners/#{unused_specific_runner.id}", admin) + post api("/projects/#{project.id}/runners/#{unused_specific_runner.id}", admin) end.to change{ project.runners.count }.by(+1) - expect(response.status).to eq(200) + expect(response.status).to eq(201) end end context 'user is not admin' do it 'should not enable runner without access to' do - put api("/projects/#{project.id}/runners/#{unused_specific_runner.id}", user) + post api("/projects/#{project.id}/runners/#{unused_specific_runner.id}", user) expect(response.status).to eq(403) end @@ -358,7 +358,7 @@ describe API::API, api: true do context 'authorized user without permissions' do it 'should not enable runner' do - put api("/projects/#{project.id}/runners/#{specific_runner2.id}", user2) + post api("/projects/#{project.id}/runners/#{specific_runner2.id}", user2) expect(response.status).to eq(403) end @@ -366,7 +366,7 @@ describe API::API, api: true do context 'unauthorized user' do it 'should not enable runner' do - put api("/projects/#{project.id}/runners/#{specific_runner2.id}") + post api("/projects/#{project.id}/runners/#{specific_runner2.id}") expect(response.status).to eq(401) end |