From b630af0c624bd2084c9940e54e26362da12ca33f Mon Sep 17 00:00:00 2001
From: Jeremy Jackson <jjackson@gitlab.com>
Date: Fri, 30 Jul 2021 19:32:32 +0000
Subject: [PATCH] Release gitlab-experiment version 0.6.3

---
 Gemfile                                                     | 2 +-
 Gemfile.lock                                                | 4 ++--
 spec/experiments/application_experiment_spec.rb             | 5 +++++
 .../new_project_readme_content_experiment_spec.rb           | 6 +++---
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/Gemfile b/Gemfile
index e4901223f95a..9b1076baf870 100644
--- a/Gemfile
+++ b/Gemfile
@@ -488,7 +488,7 @@ gem 'flipper', '~> 0.21.0'
 gem 'flipper-active_record', '~> 0.21.0'
 gem 'flipper-active_support_cache_store', '~> 0.21.0'
 gem 'unleash', '~> 3.2.2'
-gem 'gitlab-experiment', '~> 0.6.2'
+gem 'gitlab-experiment', '~> 0.6.3'
 
 # Structured logging
 gem 'lograge', '~> 0.5'
diff --git a/Gemfile.lock b/Gemfile.lock
index 38dc22cd5661..999bed3eb4d3 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -463,7 +463,7 @@ GEM
     gitlab-dangerfiles (2.3.0)
       danger (>= 8.3.1)
       danger-gitlab (>= 8.0.0)
-    gitlab-experiment (0.6.2)
+    gitlab-experiment (0.6.3)
       activesupport (>= 3.0)
       request_store (>= 1.0)
       scientist (~> 1.6, >= 1.6.0)
@@ -1468,7 +1468,7 @@ DEPENDENCIES
   github-markup (~> 1.7.0)
   gitlab-chronic (~> 0.10.5)
   gitlab-dangerfiles (~> 2.3.0)
-  gitlab-experiment (~> 0.6.2)
+  gitlab-experiment (~> 0.6.3)
   gitlab-fog-azure-rm (~> 1.1.1)
   gitlab-labkit (~> 0.21.0)
   gitlab-license (~> 2.0)
diff --git a/spec/experiments/application_experiment_spec.rb b/spec/experiments/application_experiment_spec.rb
index 4966e508f7e0..b288d074133a 100644
--- a/spec/experiments/application_experiment_spec.rb
+++ b/spec/experiments/application_experiment_spec.rb
@@ -236,6 +236,11 @@
         expect(subject.process_redirect_url(url)).to be_nil
       end
     end
+
+    it "generates the correct urls based on where the engine was mounted" do
+      url = Rails.application.routes.url_helpers.experiment_redirect_url(subject, url: 'https://docs.gitlab.com')
+      expect(url).to include("/-/experiment/namespaced%2Fstub:#{subject.context.key}?https://docs.gitlab.com")
+    end
   end
 
   context "when resolving variants" do
diff --git a/spec/experiments/new_project_readme_content_experiment_spec.rb b/spec/experiments/new_project_readme_content_experiment_spec.rb
index f76b8a1ded18..a6a81580a295 100644
--- a/spec/experiments/new_project_readme_content_experiment_spec.rb
+++ b/spec/experiments/new_project_readme_content_experiment_spec.rb
@@ -30,9 +30,9 @@
     end
 
     it "renders redirect URLs" do
-      expect(markdown).to include(
-        Rails.application.routes.url_helpers.experiment_redirect_url(subject, url: initial_url)
-      )
+      url = Rails.application.routes.url_helpers.experiment_redirect_url(subject, url: initial_url)
+      expect(url).to include("/-/experiment/#{subject.to_param}?")
+      expect(markdown).to include(url)
     end
   end
 end
-- 
GitLab