gitlab-org--gitlab-foss/spec/uploaders/namespace_file_uploader_spec.rb

17 lines
520 B
Ruby
Raw Normal View History

2017-12-06 06:36:11 -05:00
require 'spec_helper'
2018-01-29 12:57:34 -05:00
IDENTIFIER = %r{\h+/\S+}
2017-12-06 06:36:11 -05:00
describe NamespaceFileUploader do
let(:group) { build_stubbed(:group) }
let(:uploader) { described_class.new(group) }
2018-01-29 12:57:34 -05:00
let(:upload) { create(:upload, :namespace_upload, model: group) }
2017-12-06 06:36:11 -05:00
2018-01-29 12:57:34 -05:00
subject { uploader }
2017-12-06 06:36:11 -05:00
2018-01-29 12:57:34 -05:00
it_behaves_like 'builds correct paths',
store_dir: %r[uploads/-/system/namespace/\d+],
upload_path: IDENTIFIER,
absolute_path: %r[#{CarrierWave.root}/uploads/-/system/namespace/\d+/#{IDENTIFIER}]
2017-12-06 06:36:11 -05:00
end