Commit 20526df9 authored by Semyon Pupkov's avatar Semyon Pupkov

Fix already initialized constant IDENTIFIER warning

/app/spec/uploaders/personal_file_uploader_spec.rb:3: warning: already initialized constant IDENTIFIER
/app/spec/uploaders/namespace_file_uploader_spec.rb:3: warning: previous definition of IDENTIFIER was here
parent fa3528ee
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',
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}]
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',
it_behaves_like 'builds correct paths' do
let(:patterns) do
{
store_dir: %r[namespace/\d+/\h+],
upload_path: IDENTIFIER
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',
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}]
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',
it_behaves_like 'builds correct paths' do
let(:patterns) do
{
store_dir: %r[\d+/\h+],
upload_path: IDENTIFIER
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