diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/helpers/events_helper_spec.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/helpers/events_helper_spec.rb')
-rw-r--r-- | spec/helpers/events_helper_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/helpers/events_helper_spec.rb b/spec/helpers/events_helper_spec.rb index 12519390137..6f24308757d 100644 --- a/spec/helpers/events_helper_spec.rb +++ b/spec/helpers/events_helper_spec.rb @@ -150,6 +150,21 @@ describe EventsHelper do expect(helper.event_wiki_page_target_url(event)).to eq(url) end + + context 'there is no canonical slug' do + let(:event) { create(:wiki_page_event, project: project) } + + before do + event.target.slugs.update_all(canonical: false) + event.target.clear_memoization(:canonical_slug) + end + + it 'links to the home page' do + url = helper.project_wiki_url(project, Wiki::HOMEPAGE) + + expect(helper.event_wiki_page_target_url(event)).to eq(url) + end + end end describe '#event_wiki_title_html' do |