diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-11-29 13:43:58 +0100 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-12-04 17:32:33 +0100 |
commit | 10960400245ca338e32a3c55538ace976df962c6 (patch) | |
tree | a0183e5234e45cbc1ae3b4e986bea0bbb2332275 /spec/policies | |
parent | 617f43c74b967a085f6cd7afb1408cfa28187b52 (diff) | |
download | gitlab-ce-10960400245ca338e32a3c55538ace976df962c6.tar.gz |
Update effected testszj-guest-reads-public-builds
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/project_policy_spec.rb | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/spec/policies/project_policy_spec.rb b/spec/policies/project_policy_spec.rb index 34a0937d9bc..eeab9827d99 100644 --- a/spec/policies/project_policy_spec.rb +++ b/spec/policies/project_policy_spec.rb @@ -111,34 +111,34 @@ describe ProjectPolicy, models: true do context 'guests' do let(:current_user) { guest } - context 'public builds enabled' do - let(:reporter_public_build_permissions) do - reporter_permissions - [:read_build, :read_pipeline] - end + let(:reporter_public_build_permissions) do + reporter_permissions - [:read_build, :read_pipeline] + end + + it do + is_expected.to include(*guest_permissions) + is_expected.not_to include(*reporter_public_build_permissions) + is_expected.not_to include(*team_member_reporter_permissions) + is_expected.not_to include(*developer_permissions) + is_expected.not_to include(*master_permissions) + is_expected.not_to include(*owner_permissions) + end + context 'public builds enabled' do it do is_expected.to include(*guest_permissions) - is_expected.not_to include(*reporter_public_build_permissions) - is_expected.not_to include(*team_member_reporter_permissions) - is_expected.not_to include(*developer_permissions) - is_expected.not_to include(*master_permissions) - is_expected.not_to include(*owner_permissions) + is_expected.to include(:read_build, :read_pipeline) end end context 'public builds disabled' do before do - project.public_builds = false - project.save + project.update(public_builds: false) end it do is_expected.to include(*guest_permissions) - is_expected.not_to include(*reporter_permissions) - is_expected.not_to include(*team_member_reporter_permissions) - is_expected.not_to include(*developer_permissions) - is_expected.not_to include(*master_permissions) - is_expected.not_to include(*owner_permissions) + is_expected.not_to include(:read_build, :read_pipeline) end end end |