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

Show GKE cluster callout for project owner as well

parent 2cd71eb5
module CalloutsHelper module CalloutsHelper
def show_gke_cluster_integration_callout?(kube_feature_name, project) 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 end
private private
......
...@@ -26,6 +26,15 @@ describe CalloutsHelper do ...@@ -26,6 +26,15 @@ describe CalloutsHelper do
end end
context 'when user is not master' do context 'when user is not master' do
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
context 'when the user is not owner' do
before do before do
allow(project).to receive_message_chain(:team, :master?).and_return(false) allow(project).to receive_message_chain(:team, :master?).and_return(false)
end end
...@@ -33,6 +42,7 @@ describe CalloutsHelper do ...@@ -33,6 +42,7 @@ describe CalloutsHelper do
it { is_expected.to be false } it { is_expected.to be false }
end end
end end
end
context 'when user dismissed' do context 'when user dismissed' do
before do before do
......
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