From 75d48ae35bcdb8bfc0a6f661de32718710082856 Mon Sep 17 00:00:00 2001
From: winniehell <git@winniehell.de>
Date: Wed, 24 Aug 2016 02:18:38 +0200
Subject: [PATCH] Add failing test for #21334

---
 spec/lib/extracts_path_spec.rb | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/spec/lib/extracts_path_spec.rb b/spec/lib/extracts_path_spec.rb
index 86d04ecfa36..e10c1f5c547 100644
--- a/spec/lib/extracts_path_spec.rb
+++ b/spec/lib/extracts_path_spec.rb
@@ -51,6 +51,16 @@ describe ExtractsPath, lib: true do
         expect(@path).to eq(params[:path])
       end
     end
+
+    context 'subclass overrides get_id' do
+      it 'uses ref returned by get_id' do
+        allow_any_instance_of(self.class).to receive(:get_id){ '38008cb17ce1466d8fec2dfa6f6ab8dcfe5cf49e' }
+
+        assign_ref_vars
+
+        expect(@id).to eq(get_id)
+      end
+    end
   end
 
   describe '#extract_ref' do
-- 
GitLab