Changed external wiki query method to prevent attribute caching

This commit is contained in:
Francisco Javier López 2019-02-04 15:38:12 +01:00
parent 6b0b14f81d
commit 247bd12264
No known key found for this signature in database
GPG Key ID: A12DF17E9D5DDF3C
3 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -0,0 +1,5 @@
---
title: Changed external wiki query method to prevent attribute caching
merge_request: 24907
author:
type: fixed

View File

@ -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