diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /spec/views/help/index.html.haml_spec.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) | |
download | gitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/views/help/index.html.haml_spec.rb')
-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 |