Commit 7ffbfeb1 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fj-regression-external-wiki-url' into 'master'

Changed external wiki query method to prevent attribute caching

Closes #57228

See merge request gitlab-org/gitlab-ce!24907
parents 11f9edec 247bd122
......@@ -328,7 +328,7 @@ module ProjectsHelper
def external_nav_tabs(project)
[].tap do |tabs|
tabs << :external_issue_tracker if project.external_issue_tracker
tabs << :external_wiki if project.has_external_wiki?
tabs << :external_wiki if project.external_wiki
end
end
......
---
title: Changed external wiki query method to prevent attribute caching
merge_request: 24907
author:
type: fixed
......@@ -372,21 +372,16 @@ describe ProjectsHelper do
end
context 'when project has external wiki' do
before do
allow(project).to receive(:has_external_wiki?).and_return(true)
end
it 'includes external wiki tab' do
project.create_external_wiki_service(active: true, properties: { 'external_wiki_url' => 'https://gitlab.com' })
is_expected.to include(:external_wiki)
end
end
context 'when project does not have external wiki' do
before do
allow(project).to receive(:has_external_wiki?).and_return(false)
end
it 'does not include external wiki tab' do
expect(project.external_wiki).to be_nil
is_expected.not_to include(:external_wiki)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment