diff options
Diffstat (limited to 'spec/models/clusters/agent_spec.rb')
-rw-r--r-- | spec/models/clusters/agent_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/clusters/agent_spec.rb b/spec/models/clusters/agent_spec.rb index 148bb3cf870..49f41570717 100644 --- a/spec/models/clusters/agent_spec.rb +++ b/spec/models/clusters/agent_spec.rb @@ -57,4 +57,16 @@ RSpec.describe Clusters::Agent do end end end + + describe '#has_access_to?' do + let(:agent) { build(:cluster_agent) } + + it 'has access to own project' do + expect(agent.has_access_to?(agent.project)).to be_truthy + end + + it 'does not have access to other projects' do + expect(agent.has_access_to?(create(:project))).to be_falsey + end + end end |