blob: c3903a3fa55f38fa6149ee96e9f74497296d2a8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe GroupDeployKeyPolicy do
subject { described_class.new(user, group_deploy_key) }
let_it_be(:user) { create(:user) }
describe 'edit a group deploy key' do
context 'when the user does not own the group deploy key' do
let(:group_deploy_key) { create(:group_deploy_key) }
it { is_expected.to be_disallowed(:update_group_deploy_key) }
end
context 'when the user owns the group deploy key' do
let(:group_deploy_key) { create(:group_deploy_key, user: user) }
before do
user.reload
end
it { is_expected.to be_allowed(:update_group_deploy_key) }
end
end
end
|