Commit fced2216 authored by Matija Čupić's avatar Matija Čupić

Show GKE cluster callout for project owner as well

parent fffcbaeb
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
......
......@@ -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
......
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