diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-03 03:05:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-03 03:05:59 +0300 |
commit | 427b23c12718bea233931431e7d9307881a960c0 (patch) | |
tree | 5e15672783c950a5e68dd89517d7888e652e01a7 /spec/uploaders/workers | |
parent | 6d60f910762c1a92a07a4afaf1b26962f75ee4b6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/uploaders/workers')
-rw-r--r-- | spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb b/spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb index 6c2544d2efd..97e8a43f7fd 100644 --- a/spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb +++ b/spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb @@ -42,33 +42,23 @@ describe ObjectStorage::MigrateUploadsWorker, :sidekiq do end describe '.sanity_check!' do - shared_examples 'raises a SanityCheckError' do + shared_examples 'raises a SanityCheckError' do |expected_message| let(:mount_point) { nil } it do expect { described_class.sanity_check!(uploads, model_class, mount_point) } - .to raise_error(described_class::SanityCheckError) + .to raise_error(described_class::SanityCheckError).with_message(expected_message) end end - before do - stub_const("WrongModel", Class.new) - end - context 'uploader types mismatch' do let!(:outlier) { create(:upload, uploader: 'GitlabUploader') } - include_examples 'raises a SanityCheckError' - end - - context 'model types mismatch' do - let!(:outlier) { create(:upload, model_type: 'WrongModel') } - - include_examples 'raises a SanityCheckError' + include_examples 'raises a SanityCheckError', /Multiple uploaders found/ end context 'mount point not found' do - include_examples 'raises a SanityCheckError' do + include_examples 'raises a SanityCheckError', /Mount point [a-z:]+ not found in/ do let(:mount_point) { :potato } end end |