Commit 5f8a3302 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix-warnings' into 'master'

Fix already initialized constant IDENTIFIER warning

See merge request gitlab-org/gitlab-ce!23681
parents e8d187ca 20526df9
require 'spec_helper'
IDENTIFIER = %r{\h+/\S+}
describe NamespaceFileUploader do
let(:group) { build_stubbed(:group) }
let(:uploader) { described_class.new(group) }
let(:upload) { create(:upload, :namespace_upload, model: group) }
let(:identifier) { %r{\h+/\S+} }
subject { uploader }
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}]
it_behaves_like 'builds correct paths' do
let(:patterns) do
{
store_dir: %r[uploads/-/system/namespace/\d+],
upload_path: identifier,
absolute_path: %r[#{CarrierWave.root}/uploads/-/system/namespace/\d+/#{identifier}]
}
end
end
context "object_store is REMOTE" do
before do
......@@ -21,9 +25,14 @@ describe NamespaceFileUploader do
include_context 'with storage', described_class::Store::REMOTE
it_behaves_like 'builds correct paths',
store_dir: %r[namespace/\d+/\h+],
upload_path: IDENTIFIER
it_behaves_like 'builds correct paths' do
let(:patterns) do
{
store_dir: %r[namespace/\d+/\h+],
upload_path: identifier
}
end
end
end
context '.base_dir' do
......
require 'spec_helper'
IDENTIFIER = %r{\h+/\S+}
describe PersonalFileUploader do
let(:model) { create(:personal_snippet) }
let(:uploader) { described_class.new(model) }
let(:upload) { create(:upload, :personal_snippet_upload) }
let(:identifier) { %r{\h+/\S+} }
subject { uploader }
it_behaves_like 'builds correct paths',
store_dir: %r[uploads/-/system/personal_snippet/\d+],
upload_path: IDENTIFIER,
absolute_path: %r[#{CarrierWave.root}/uploads/-/system/personal_snippet/\d+/#{IDENTIFIER}]
it_behaves_like 'builds correct paths' do
let(:patterns) do
{
store_dir: %r[uploads/-/system/personal_snippet/\d+],
upload_path: identifier,
absolute_path: %r[#{CarrierWave.root}/uploads/-/system/personal_snippet/\d+/#{identifier}]
}
end
end
context "object_store is REMOTE" do
before do
......@@ -21,9 +25,14 @@ describe PersonalFileUploader do
include_context 'with storage', described_class::Store::REMOTE
it_behaves_like 'builds correct paths',
store_dir: %r[\d+/\h+],
upload_path: IDENTIFIER
it_behaves_like 'builds correct paths' do
let(:patterns) do
{
store_dir: %r[\d+/\h+],
upload_path: identifier
}
end
end
end
describe '#to_h' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment