diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-01-08 17:38:53 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-01-08 17:38:53 +0100 |
commit | 0614793b38db4711053cbcb4fa80d9c8cc492eec (patch) | |
tree | 528e7b413ea84dd45bc2c02e9820c6d18e3f2d38 /spec/services/projects | |
parent | 1e927d39b4bf6d1177dee0dd4a6c60bf270db3f2 (diff) | |
download | gitlab-ce-0614793b38db4711053cbcb4fa80d9c8cc492eec.tar.gz |
DRY up upload and download servicesapi-project-upload
Diffstat (limited to 'spec/services/projects')
-rw-r--r-- | spec/services/projects/download_service_spec.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/services/projects/download_service_spec.rb b/spec/services/projects/download_service_spec.rb index 5ceed5af9a5..f252e2c5902 100644 --- a/spec/services/projects/download_service_spec.rb +++ b/spec/services/projects/download_service_spec.rb @@ -33,12 +33,12 @@ describe Projects::DownloadService, services: true do @link_to_file = download_file(@project, url) end - it { expect(@link_to_file).to have_key('alt') } - it { expect(@link_to_file).to have_key('url') } - it { expect(@link_to_file).to have_key('is_image') } - it { expect(@link_to_file['is_image']).to be true } - it { expect(@link_to_file['url']).to match('rails_sample.jpg') } - it { expect(@link_to_file['alt']).to eq('rails_sample') } + it { expect(@link_to_file).to have_key(:alt) } + it { expect(@link_to_file).to have_key(:url) } + it { expect(@link_to_file).to have_key(:is_image) } + it { expect(@link_to_file[:is_image]).to be true } + it { expect(@link_to_file[:url]).to match('rails_sample.jpg') } + it { expect(@link_to_file[:alt]).to eq('rails_sample') } end context 'a txt file' do @@ -47,12 +47,12 @@ describe Projects::DownloadService, services: true do @link_to_file = download_file(@project, url) end - it { expect(@link_to_file).to have_key('alt') } - it { expect(@link_to_file).to have_key('url') } - it { expect(@link_to_file).to have_key('is_image') } - it { expect(@link_to_file['is_image']).to be false } - it { expect(@link_to_file['url']).to match('doc_sample.txt') } - it { expect(@link_to_file['alt']).to eq('doc_sample.txt') } + it { expect(@link_to_file).to have_key(:alt) } + it { expect(@link_to_file).to have_key(:url) } + it { expect(@link_to_file).to have_key(:is_image) } + it { expect(@link_to_file[:is_image]).to be false } + it { expect(@link_to_file[:url]).to match('doc_sample.txt') } + it { expect(@link_to_file[:alt]).to eq('doc_sample.txt') } end end end |