diff options
-rw-r--r-- | app/helpers/callouts_helper.rb | 4 | ||||
-rw-r--r-- | spec/helpers/callouts_helper_spec.rb | 16 |
2 files changed, 16 insertions, 4 deletions
diff --git a/app/helpers/callouts_helper.rb b/app/helpers/callouts_helper.rb index 199652b1175..e65daa572a8 100644 --- a/app/helpers/callouts_helper.rb +++ b/app/helpers/callouts_helper.rb @@ -1,6 +1,8 @@ module CalloutsHelper def show_gke_cluster_integration_callout?(kube_feature_name, project) - current_user && !user_dismissed?(kube_feature_name) && project.team.master?(current_user) + current_user && !user_dismissed?(kube_feature_name) && + (project.team.master?(current_user) || + current_user == project.owner) end private diff --git a/spec/helpers/callouts_helper_spec.rb b/spec/helpers/callouts_helper_spec.rb index f160aafbd7b..8dd97e22477 100644 --- a/spec/helpers/callouts_helper_spec.rb +++ b/spec/helpers/callouts_helper_spec.rb @@ -26,11 +26,21 @@ describe CalloutsHelper do end context 'when user is not master' do - before do - allow(project).to receive_message_chain(:team, :master?).and_return(false) + context 'when the user is owner' do + before do + allow(project).to receive(:owner).and_return(user) + end + + it { is_expected.to be true } end - it { is_expected.to be false } + context 'when the user is not owner' do + before do + allow(project).to receive_message_chain(:team, :master?).and_return(false) + end + + it { is_expected.to be false } + end end end |