Commit 977996d2 authored by Matija Čupić's avatar Matija Čupić

Add check for guest user

parent 8be4f3ec
module CalloutsHelper
def show_gke_cluster_integration_callout?(kube_feature_name, project)
!user_dismissed?(kube_feature_name) && project.team.master?(current_user)
current_user && !user_dismissed?(kube_feature_name) && project.team.master?(current_user)
end
private
......
......@@ -41,5 +41,13 @@ describe CalloutsHelper do
it { is_expected.to be false }
end
context 'when the user is not logged in' do
before do
allow(helper).to receive(:current_user).and_return(nil)
end
it { is_expected.to be_falsey }
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