diff options
| author | Katarzyna Kobierska <kkobierska@gmail.com> | 2016-08-24 10:16:58 +0200 |
|---|---|---|
| committer | Katarzyna Kobierska <kkobierska@gmail.com> | 2016-09-07 12:10:49 +0200 |
| commit | 257c2acde7a0be63d955df63ca29488236e5654f (patch) | |
| tree | 72e09ec90e217b68f63f5515db6d7bbc4eff4085 /spec/requests/ci/api/lint_spec.rb | |
| parent | 0e4c0e7818e7ab19b6639bc4c44bc373ba8219d9 (diff) | |
| download | gitlab-ce-257c2acde7a0be63d955df63ca29488236e5654f.tar.gz | |
Add params requires to lint
Diffstat (limited to 'spec/requests/ci/api/lint_spec.rb')
| -rw-r--r-- | spec/requests/ci/api/lint_spec.rb | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/spec/requests/ci/api/lint_spec.rb b/spec/requests/ci/api/lint_spec.rb index 4a18fd0b6b3..cc3d77f3b38 100644 --- a/spec/requests/ci/api/lint_spec.rb +++ b/spec/requests/ci/api/lint_spec.rb @@ -9,41 +9,32 @@ describe Ci::API::API do end describe 'POST /ci/lint' do - context "with valid .gitlab-ci.yaml content" do - context "authorized user" do - it "validate content" do - post ci_api('/lint'), { private_token: user.private_token, content: yaml_content } - - expect(response).to have_http_status(201) - expect(json_response).to be_an Hash - expect(json_response['status']).to eq('syntax is correct') - end - end - - context "unauthorized user" do - it "does not validate content" do + context 'with valid .gitlab-ci.yaml content' do + context 'authorized user' do + it 'validate content' do post ci_api('/lint'), { content: yaml_content } - expect(response).to have_http_status(401) + expect(response).to have_http_status(200) + expect(json_response).to be_an Hash + expect(json_response['status']).to eq('valid') end end end - context "with invalid .gitlab_ci.yml content" do - it "validate content" do - post ci_api('/lint'), { private_token: user.private_token, content: 'invalid content' } + context 'with invalid .gitlab_ci.yml content' do + it 'validate content' do + post ci_api('/lint'), { content: 'invalid content' } - expect(response).to have_http_status(500) - expect(json_response['status']).to eq('syntax is incorrect') + expect(response).to have_http_status(200) + expect(json_response['status']).to eq('invalid') end end - context "no content" do - it "shows error message" do - post ci_api('/lint'), { private_token: user.private_token } + context 'no content parameters' do + it 'shows error message' do + post ci_api('/lint') expect(response).to have_http_status(400) - expect(json_response['message']).to eq('Please provide content of .gitlab-ci.yml') end end end |
