diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-01-12 16:39:15 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-01-14 14:48:16 +0300 |
commit | e8995f9fd5c12882eafcf3766627f64a3d6f623d (patch) | |
tree | a7ca8a8f6d599872b846127a891992f7924f5085 /spec | |
parent | cf00a808cc9896093be209dc5d6bfbea93b6226b (diff) |
Modify artifacts upload API endpoint, add artifacts metadata
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/ci/api/builds_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/requests/ci/api/builds_spec.rb b/spec/requests/ci/api/builds_spec.rb index c27e87c4acc..4eb5f2e6828 100644 --- a/spec/requests/ci/api/builds_spec.rb +++ b/spec/requests/ci/api/builds_spec.rb @@ -210,6 +210,31 @@ describe Ci::API::API do end end + context "should post artifacts metadata" do + let!(:artifacts) { file_upload } + let!(:metadata) { file_upload2 } + + before do + build.run! + + post_data = { + 'file.path' => artifacts.path, + 'file.name' => artifacts.original_filename, + 'metadata.path' => metadata.path, + 'metadata.name' => metadata.original_filename + } + + post post_url, post_data, headers_with_token + end + + it 'stores artifacts and artifacts metadata' do + expect(response.status).to eq(201) + expect(json_response['artifacts_file']['filename']).to eq(artifacts.original_filename) + expect(json_response['artifacts_metadata']['filename']).to eq(metadata.original_filename) + end + end + + context "should fail to post too large artifact" do before do build.run! |