diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2016-11-01 12:18:49 +0300 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2016-11-01 12:18:49 +0300 |
commit | f6cff8f7bc6608d53baa36768034ab9f91323abe (patch) | |
tree | e494c019ab4061d71a72d418dd909670ae24e056 /spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb | |
parent | 266fcfb1935c8aa8c6ac3d2ae71530c441b08675 (diff) |
Fix relative links in Markdown wiki when displayed in "Project" tab
Refers to #23806.
Diffstat (limited to 'spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb')
-rw-r--r-- | spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb b/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb new file mode 100644 index 00000000000..b4f5f6b3fc5 --- /dev/null +++ b/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb @@ -0,0 +1,44 @@ +require 'spec_helper' + +describe 'Projects > Wiki > User views wiki in project page', feature: true do + let(:user) { create(:user) } + let(:project) { create(:empty_project) } + + before do + project.team << [user, :master] + login_as(user) + end + + context 'when repository is disabled for project' do + before do + project.project_feature.update!( + repository_access_level: ProjectFeature::DISABLED, + merge_requests_access_level: ProjectFeature::DISABLED, + builds_access_level: ProjectFeature::DISABLED + ) + end + + context 'when wiki homepage contains a link' do + before do + WikiPages::CreateService.new( + project, + user, + title: 'home', + content: '[some link](other-page)' + ).execute + end + + it 'displays the correct URL for the link' do + visit namespace_project_path(project.namespace, project) + expect(page).to have_link( + 'some link', + href: namespace_project_wiki_path( + project.namespace, + project, + 'other-page' + ) + ) + end + end + end +end |