diff options
author | Toon Claes <toon@gitlab.com> | 2019-02-28 19:57:34 +0100 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2019-02-28 19:57:34 +0100 |
commit | 62d7990b9bb30cf33ed87017c5c633d1cccc75c2 (patch) | |
tree | c3e1b69c58a412ba1c6f50a0337a23d9f9d6e1a4 /spec/services/upload_service_spec.rb | |
parent | f6453eca992a9c142268e78ac782cef98110d183 (diff) | |
download | gitlab-ce-tc-standard-gem.tar.gz |
Ran standardrb --fix on the whole codebasetc-standard-gem
Inspired by https://twitter.com/searls/status/1101137953743613952 I
decided to try https://github.com/testdouble/standard on our codebase.
It's opinionated, but at least it's a _standard_.
Diffstat (limited to 'spec/services/upload_service_spec.rb')
-rw-r--r-- | spec/services/upload_service_spec.rb | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/spec/services/upload_service_spec.rb b/spec/services/upload_service_spec.rb index 4a809d5bf18..21d0cf68cfa 100644 --- a/spec/services/upload_service_spec.rb +++ b/spec/services/upload_service_spec.rb @@ -1,64 +1,64 @@ -require 'spec_helper' +require "spec_helper" describe UploadService do - describe 'File service' do + describe "File service" do before do @user = create(:user) @project = create(:project, creator_id: @user.id, namespace: @user.namespace) end - context 'for valid gif file' do + context "for valid gif file" do before do - gif = fixture_file_upload('spec/fixtures/banana_sample.gif', 'image/gif') + gif = fixture_file_upload("spec/fixtures/banana_sample.gif", "image/gif") @link_to_file = upload_file(@project, gif) 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_value('banana_sample') } - it { expect(@link_to_file[:url]).to match('banana_sample.gif') } + it { expect(@link_to_file).to have_value("banana_sample") } + it { expect(@link_to_file[:url]).to match("banana_sample.gif") } end - context 'for valid png file' do + context "for valid png file" do before do - png = fixture_file_upload('spec/fixtures/dk.png', - 'image/png') + png = fixture_file_upload("spec/fixtures/dk.png", + "image/png") @link_to_file = upload_file(@project, png) 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_value('dk') } - it { expect(@link_to_file[:url]).to match('dk.png') } + it { expect(@link_to_file).to have_value("dk") } + it { expect(@link_to_file[:url]).to match("dk.png") } end - context 'for valid jpg file' do + context "for valid jpg file" do before do - jpg = fixture_file_upload('spec/fixtures/rails_sample.jpg', 'image/jpg') + jpg = fixture_file_upload("spec/fixtures/rails_sample.jpg", "image/jpg") @link_to_file = upload_file(@project, jpg) 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_value('rails_sample') } - it { expect(@link_to_file[:url]).to match('rails_sample.jpg') } + it { expect(@link_to_file).to have_value("rails_sample") } + it { expect(@link_to_file[:url]).to match("rails_sample.jpg") } end - context 'for txt file' do + context "for txt file" do before do - txt = fixture_file_upload('spec/fixtures/doc_sample.txt', 'text/plain') + txt = fixture_file_upload("spec/fixtures/doc_sample.txt", "text/plain") @link_to_file = upload_file(@project, txt) 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_value('doc_sample.txt') } - it { expect(@link_to_file[:url]).to match('doc_sample.txt') } + it { expect(@link_to_file).to have_value("doc_sample.txt") } + it { expect(@link_to_file[:url]).to match("doc_sample.txt") } end - context 'for too large a file' do + context "for too large a file" do before do - txt = fixture_file_upload('spec/fixtures/doc_sample.txt', 'text/plain') + txt = fixture_file_upload("spec/fixtures/doc_sample.txt", "text/plain") allow(txt).to receive(:size) { 1000.megabytes.to_i } @link_to_file = upload_file(@project, txt) end |