diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2018-08-21 10:27:49 +0200 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2018-08-21 10:27:49 +0200 |
commit | 455f34b624efff5d8eb191e13d1fe8d14903b161 (patch) | |
tree | 56d514188414d9125d5d0aa8bc559b06cd0cec39 | |
parent | 4eee541e778b5a2697fef61ba3556688f8c4545b (diff) | |
download | gitlab-ce-api-license-field.tar.gz |
Use match_schemaapi-license-field
-rw-r--r-- | spec/fixtures/api/schemas/entities/license_information.json | 4 | ||||
-rw-r--r-- | spec/requests/api/projects_spec.rb | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/spec/fixtures/api/schemas/entities/license_information.json b/spec/fixtures/api/schemas/entities/license_information.json new file mode 100644 index 00000000000..2f8292eafdb --- /dev/null +++ b/spec/fixtures/api/schemas/entities/license_information.json @@ -0,0 +1,4 @@ +{ + "name": "MIT License", + "spdx_id": "MIT" +}
\ No newline at end of file diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 4e505bcca84..9ae7eb453b9 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -1026,9 +1026,7 @@ describe API::Projects do get api("/projects/#{project.id}", user) expect(response).to have_http_status(200) - expect(json_response['license']).to be_a Hash - expect(json_response['license']['name']).to be_present - expect(json_response['license']['spdx_id']).to be_present + expect(json_response['license']).to match_schema('entities/license_information') end it 'returns nil if no license' do |