diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-17 21:10:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-17 21:10:42 +0300 |
commit | 49bb78aac34a111c0fb13aae3a83b078be351fd3 (patch) | |
tree | 510df08e78b39ef88631f8f25bdc371a4661caa9 /spec/views/help | |
parent | 68c476dbd8a2c670aeeebffce8b63b554a3ac7f0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views/help')
-rw-r--r-- | spec/views/help/index.html.haml_spec.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/views/help/index.html.haml_spec.rb b/spec/views/help/index.html.haml_spec.rb index c59790a346e..600e431b7ef 100644 --- a/spec/views/help/index.html.haml_spec.rb +++ b/spec/views/help/index.html.haml_spec.rb @@ -21,6 +21,11 @@ RSpec.describe 'help/index' do end context 'when logged in' do + def version_link_regexp(path) + base_url = "#{view.source_host_url}/#{view.source_code_group}" + %r{#{Regexp.escape(base_url)}/(gitlab|gitlab\-foss)/#{Regexp.escape(path)}} + end + before do stub_user end @@ -31,7 +36,7 @@ RSpec.describe 'help/index' do render expect(rendered).to match '8.0.2' - expect(rendered).to have_link('8.0.2', href: %r{https://gitlab.com/gitlab-org/(gitlab|gitlab-foss)/-/tags/v8.0.2}) + expect(rendered).to have_link('8.0.2', href: version_link_regexp('-/tags/v8.0.2')) end it 'shows a link to the commit for pre-releases' do @@ -40,7 +45,7 @@ RSpec.describe 'help/index' do render expect(rendered).to match '8.0.2' - expect(rendered).to have_link('abcdefg', href: %r{https://gitlab.com/gitlab-org/(gitlab|gitlab-foss)/-/commits/abcdefg}) + expect(rendered).to have_link('abcdefg', href: version_link_regexp('-/commits/abcdefg')) end end end |