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:
Diffstat (limited to 'spec/workers/create_note_diff_file_worker_spec.rb')
-rw-r--r--spec/workers/create_note_diff_file_worker_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/workers/create_note_diff_file_worker_spec.rb b/spec/workers/create_note_diff_file_worker_spec.rb
index 4c1df8ade06..6d1d6d93e44 100644
--- a/spec/workers/create_note_diff_file_worker_spec.rb
+++ b/spec/workers/create_note_diff_file_worker_spec.rb
@@ -14,5 +14,23 @@ RSpec.describe CreateNoteDiffFileWorker do
described_class.new.perform(diff_note.id)
end
+
+ context "when the supplied diff_note_id doesn't belong to an existing DiffNote" do
+ it "returns nil without raising an error" do
+ expect_any_instance_of(DiffNote).not_to receive(:create_diff_file)
+ .and_call_original
+
+ described_class.new.perform(non_existing_record_id)
+ end
+ end
+
+ context "when called with a missing diff_note id" do
+ it "returns nil without creating diff file" do
+ expect_any_instance_of(DiffNote).not_to receive(:create_diff_file)
+ .and_call_original
+
+ described_class.new.perform(nil)
+ end
+ end
end
end