Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-23 21:07:55 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-23 21:07:55 +0300
commit5421d61b1d5ffe11a9c7afbe2259b4e4d0e7c993 (patch)
tree093cfd5a5f80119f6e9c7ccd2c646ca2482cc3d2 /spec/lib/gitlab/gfm
parentbc0f141f2f073a971aad1eb5349bb718747df028 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/gfm')
-rw-r--r--spec/lib/gitlab/gfm/uploads_rewriter_spec.rb22
1 files changed, 17 insertions, 5 deletions
diff --git a/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb b/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb
index b1bff242f33..e1c0da69317 100644
--- a/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb
+++ b/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb
@@ -31,7 +31,7 @@ RSpec.describe Gitlab::Gfm::UploadsRewriter do
referenced_files.compact.select(&:exists?)
end
- shared_examples "files are accessible" do
+ shared_examples 'files are accessible' do
describe '#rewrite' do
subject(:rewrite) { new_text }
@@ -82,6 +82,18 @@ RSpec.describe Gitlab::Gfm::UploadsRewriter do
rewrite
expect(new_files).to be_empty
+ expect(new_text).to eq(text)
+ end
+
+ it 'skips non-existant files' do
+ allow_next_instance_of(FileUploader) do |file|
+ allow(file).to receive(:exists?).and_return(false)
+ end
+
+ rewrite
+
+ expect(new_files).to be_empty
+ expect(new_text).to eq(text)
end
end
end
@@ -107,11 +119,11 @@ RSpec.describe Gitlab::Gfm::UploadsRewriter do
end
end
- context "file are stored locally" do
- include_examples "files are accessible"
+ context 'file are stored locally' do
+ include_examples 'files are accessible'
end
- context "files are stored remotely" do
+ context 'files are stored remotely' do
before do
stub_uploads_object_storage(FileUploader)
@@ -120,7 +132,7 @@ RSpec.describe Gitlab::Gfm::UploadsRewriter do
end
end
- include_examples "files are accessible"
+ include_examples 'files are accessible'
end
describe '#needs_rewrite?' do