diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-18 01:52:17 +0300 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-19 02:04:31 +0300 |
commit | b44a2c801a64fb282cea794871fcfcf81e4ec539 (patch) | |
tree | 32e699b6efa548048abe11f29f84e85e3d2a034f /spec/requests/api/commit_statuses_spec.rb | |
parent | 5d68c23792e87e710877e4baf57605bcf11a6cb5 (diff) |
Update specs to rails5 format
Updates specs to use new rails5 format.
The old format:
`get :show, { some: params }, { some: headers }`
The new format:
`get :show, params: { some: params }, headers: { some: headers }`
Diffstat (limited to 'spec/requests/api/commit_statuses_spec.rb')
-rw-r--r-- | spec/requests/api/commit_statuses_spec.rb | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/spec/requests/api/commit_statuses_spec.rb b/spec/requests/api/commit_statuses_spec.rb index a43304c9b83..9388343c392 100644 --- a/spec/requests/api/commit_statuses_spec.rb +++ b/spec/requests/api/commit_statuses_spec.rb @@ -51,7 +51,7 @@ describe API::CommitStatuses do context 'all commit statuses' do before do - get api(get_url, reporter), all: 1 + get api(get_url, reporter), params: { all: 1 } end it 'returns all commit statuses' do @@ -66,7 +66,7 @@ describe API::CommitStatuses do context 'latest commit statuses for specific ref' do before do - get api(get_url, reporter), ref: 'develop' + get api(get_url, reporter), params: { ref: 'develop' } end it 'returns latest commit statuses for specific ref' do @@ -79,7 +79,7 @@ describe API::CommitStatuses do context 'latest commit statues for specific name' do before do - get api(get_url, reporter), name: 'coverage' + get api(get_url, reporter), params: { name: 'coverage' } end it 'return latest commit statuses for specific name' do @@ -133,7 +133,7 @@ describe API::CommitStatuses do context "for #{status}" do context 'uses only required parameters' do it 'creates commit status' do - post api(post_url, developer), state: status + post api(post_url, developer), params: { state: status } expect(response).to have_gitlab_http_status(201) expect(json_response['sha']).to eq(commit.id) @@ -153,12 +153,12 @@ describe API::CommitStatuses do context 'transitions status from pending' do before do - post api(post_url, developer), state: 'pending' + post api(post_url, developer), params: { state: 'pending' } end %w[running success failed canceled].each do |status| it "to #{status}" do - expect { post api(post_url, developer), state: status }.not_to change { CommitStatus.count } + expect { post api(post_url, developer), params: { state: status } }.not_to change { CommitStatus.count } expect(response).to have_gitlab_http_status(201) expect(json_response['status']).to eq(status) @@ -169,7 +169,7 @@ describe API::CommitStatuses do context 'with all optional parameters' do context 'when creating a commit status' do subject do - post api(post_url, developer), { + post api(post_url, developer), params: { state: 'success', context: 'coverage', ref: 'master', @@ -206,7 +206,7 @@ describe API::CommitStatuses do context 'when updatig a commit status' do before do - post api(post_url, developer), { + post api(post_url, developer), params: { state: 'running', context: 'coverage', ref: 'master', @@ -215,7 +215,7 @@ describe API::CommitStatuses do target_url: 'http://gitlab.com/status' } - post api(post_url, developer), { + post api(post_url, developer), params: { state: 'success', name: 'coverage', ref: 'master', @@ -244,10 +244,10 @@ describe API::CommitStatuses do context 'when retrying a commit status' do before do post api(post_url, developer), - { state: 'failed', name: 'test', ref: 'master' } + params: { state: 'failed', name: 'test', ref: 'master' } post api(post_url, developer), - { state: 'success', name: 'test', ref: 'master' } + params: { state: 'success', name: 'test', ref: 'master' } end it 'correctly posts a new commit status' do @@ -265,7 +265,7 @@ describe API::CommitStatuses do context 'when status is invalid' do before do - post api(post_url, developer), state: 'invalid' + post api(post_url, developer), params: { state: 'invalid' } end it 'does not create commit status' do @@ -287,7 +287,7 @@ describe API::CommitStatuses do let(:sha) { 'invalid_sha' } before do - post api(post_url, developer), state: 'running' + post api(post_url, developer), params: { state: 'running' } end it 'returns not found error' do @@ -297,8 +297,10 @@ describe API::CommitStatuses do context 'when target URL is an invalid address' do before do - post api(post_url, developer), state: 'pending', - target_url: 'invalid url' + post api(post_url, developer), params: { + state: 'pending', + target_url: 'invalid url' + } end it 'responds with bad request status and validation errors' do @@ -311,7 +313,7 @@ describe API::CommitStatuses do context 'reporter user' do before do - post api(post_url, reporter), state: 'running' + post api(post_url, reporter), params: { state: 'running' } end it 'does not create commit status' do @@ -321,7 +323,7 @@ describe API::CommitStatuses do context 'guest user' do before do - post api(post_url, guest), state: 'running' + post api(post_url, guest), params: { state: 'running' } end it 'does not create commit status' do |