2016-11-24 13:41:30 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
describe 'Projects > Wiki > User views wiki in project page' do
|
2016-11-24 13:41:30 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
2018-11-18 11:00:15 +05:30
|
|
|
project.add_maintainer(user)
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in(user)
|
2016-11-24 13:41:30 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
context 'when repository is disabled for project' do
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:project) do
|
2017-09-10 17:25:29 +05:30
|
|
|
create(:project,
|
2018-10-15 14:42:47 +05:30
|
|
|
:wiki_repo,
|
2017-08-17 22:00:37 +05:30
|
|
|
:repository_disabled,
|
|
|
|
:merge_requests_disabled,
|
|
|
|
:builds_disabled)
|
2016-11-24 13:41:30 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
context 'when wiki homepage contains a link' do
|
|
|
|
before do
|
2018-03-17 18:26:18 +05:30
|
|
|
create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: '[some link](other-page)' })
|
2016-11-24 13:41:30 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it 'displays the correct URL for the link' do
|
2017-09-10 17:25:29 +05:30
|
|
|
visit project_path(project)
|
2016-11-24 13:41:30 +05:30
|
|
|
expect(page).to have_link(
|
|
|
|
'some link',
|
2017-09-10 17:25:29 +05:30
|
|
|
href: project_wiki_path(project, 'other-page')
|
2016-11-24 13:41:30 +05:30
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|