diff options
author | Katarzyna Kobierska <kkobierska@gmail.com> | 2016-08-26 12:49:59 +0200 |
---|---|---|
committer | Katarzyna Kobierska <kkobierska@gmail.com> | 2016-09-07 12:10:49 +0200 |
commit | bbba62fa51419b14be4f39873afdd45b5b248764 (patch) | |
tree | c10b2c727c4d392fb0956bb1d61b6cfe36b6eaff /spec/requests/api/lint_spec.rb | |
parent | cfa18dab86d5408814f4c6083b843205c3d1599e (diff) | |
download | gitlab-ce-bbba62fa51419b14be4f39873afdd45b5b248764.tar.gz |
Fix errors and grammar
Diffstat (limited to 'spec/requests/api/lint_spec.rb')
-rw-r--r-- | spec/requests/api/lint_spec.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/spec/requests/api/lint_spec.rb b/spec/requests/api/lint_spec.rb index 78a9b415405..8bad57819c8 100644 --- a/spec/requests/api/lint_spec.rb +++ b/spec/requests/api/lint_spec.rb @@ -9,7 +9,7 @@ describe API::API do describe 'POST /lint' do context 'with valid .gitlab-ci.yaml content' do - it 'validates content' do + it 'validates the content' do post api('/lint'), { content: yaml_content } expect(response).to have_http_status(200) @@ -18,29 +18,30 @@ describe API::API do end end - context 'with invalid .gitlab_ci.yml' do - it 'validates content and shows correct errors' do + context 'with an invalid .gitlab_ci.yml' do + it 'validates the content and shows an error message' do post api('/lint'), { content: 'invalid content' } expect(response).to have_http_status(200) expect(json_response['status']).to eq('invalid') - expect(json_response['errors']).to eq(['Invalid configuration format']) + expect(json_response['error']).to eq(['Invalid configuration format']) end - it "validates content and shows configuration error" do + it "validates the content and shows a configuration error" do post api('/lint'), { content: '{ image: "ruby:2.1", services: ["postgres"] }' } expect(response).to have_http_status(200) expect(json_response['status']).to eq('invalid') - expect(json_response['errors']).to eq(['jobs config should contain at least one visible job']) + expect(json_response['error']).to eq(['jobs config should contain at least one visible job']) end end - context 'no content parameters' do - it 'shows error message' do + context 'without the content parameter' do + it 'shows an error message' do post api('/lint') expect(response).to have_http_status(400) + expect(json_response['error']).to eq('content is missing') end end end |