diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-29 13:12:57 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-30 11:44:18 +0300 |
commit | 0b8cefd3b2385a21cfed779bd659978c0402766d (patch) | |
tree | 9c4753cc8a610c153fb64e99dd619f3b8f0fc4d8 /spec/lib/gitlab/gfm | |
parent | 701976e0815c273ff4a4c6e4d3489db0ce2f0860 (diff) |
Get FileUploader into test harness using factory
This attempts to get CarrierWave's uploader - `FileUploader` into test
harness using a factory. that makes it easier to build an instance of
it.
Along with !3435 it may be easier to use uploaders in tests
Diffstat (limited to 'spec/lib/gitlab/gfm')
-rw-r--r-- | spec/lib/gitlab/gfm/uploads_rewriter_spec.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb b/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb index 7027954ef27..770c08148c9 100644 --- a/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb +++ b/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb @@ -7,10 +7,7 @@ describe Gitlab::Gfm::UploadsRewriter do let(:rewriter) { described_class.new(text, old_project, user) } context 'text contains links to uploads' do - let(:path) { Rails.root + 'spec/fixtures/rails_sample.jpg' } - let(:file) { fixture_file_upload(path, 'image/jpg') } - let(:uploader) { FileUploader.new(old_project) } - let!(:store) { uploader.store!(file) } # TODO, see #xxx (carrierwave issue) + let(:uploader) { build(:file_uploader, project: old_project) } let(:markdown) { uploader.to_h[:markdown] } let(:text) { "Text and #{markdown}"} |