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

Add check for guest user

parent fbbbc152
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