diff options
Diffstat (limited to 'spec/models/deploy_key_spec.rb')
-rw-r--r-- | spec/models/deploy_key_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/models/deploy_key_spec.rb b/spec/models/deploy_key_spec.rb index 337fa40b4ba..528b36babc6 100644 --- a/spec/models/deploy_key_spec.rb +++ b/spec/models/deploy_key_spec.rb @@ -20,6 +20,20 @@ RSpec.describe DeployKey, :mailer do .source(:project) end + it do + is_expected.to have_many(:deploy_keys_projects_with_readonly_access) + .conditions(can_push: false) + .class_name('DeployKeysProject') + .inverse_of(:deploy_key) + end + + it do + is_expected.to have_many(:projects_with_readonly_access) + .class_name('Project') + .through(:deploy_keys_projects_with_readonly_access) + .source(:project) + end + it { is_expected.to have_many(:projects) } it { is_expected.to have_many(:protected_branch_push_access_levels).inverse_of(:deploy_key) } it { is_expected.to have_many(:protected_tag_create_access_levels).inverse_of(:deploy_key) } @@ -95,7 +109,7 @@ RSpec.describe DeployKey, :mailer do it { is_expected.to be_empty } end - context 'and this deploy key has not write access to the project' do + context 'and this deploy key has no write access to the project' do let(:specific_deploy_key) { create(:deploy_key, deploy_keys_projects: [create(:deploy_keys_project, project: project)]) } it { is_expected.to be_empty } |