summaryrefslogtreecommitdiff
path: root/spec/serializers/group_child_entity_spec.rb
diff options
context:
space:
mode:
authorImre Farkas <ifarkas@gitlab.com>2019-04-09 15:38:58 +0000
committerAndreas Brandl <abrandl@gitlab.com>2019-04-09 15:38:58 +0000
commit9bc5ed14fe97fe63cd5be30c013c6af978715621 (patch)
tree74e1548a29b4683e94720b346a4fc41a068b2583 /spec/serializers/group_child_entity_spec.rb
parenta6218f1bcd78f656d57330e764d3f98e1fb1f3f3 (diff)
downloadgitlab-ce-9bc5ed14fe97fe63cd5be30c013c6af978715621.tar.gz
Move Contribution Analytics related spec in spec/features/groups/group_page_with_external_authorization_service_spec to EE
Diffstat (limited to 'spec/serializers/group_child_entity_spec.rb')
-rw-r--r--spec/serializers/group_child_entity_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/serializers/group_child_entity_spec.rb b/spec/serializers/group_child_entity_spec.rb
index d02b4c554b1..b58d95ccb43 100644
--- a/spec/serializers/group_child_entity_spec.rb
+++ b/spec/serializers/group_child_entity_spec.rb
@@ -1,6 +1,7 @@
require 'spec_helper'
describe GroupChildEntity do
+ include ExternalAuthorizationServiceHelpers
include Gitlab::Routing.url_helpers
let(:user) { create(:user) }
@@ -109,4 +110,22 @@ describe GroupChildEntity do
it_behaves_like 'group child json'
end
+
+ describe 'for a project with external authorization enabled' do
+ let(:object) do
+ create(:project, :with_avatar,
+ description: 'Awesomeness')
+ end
+
+ before do
+ enable_external_authorization_service_check
+ object.add_maintainer(user)
+ end
+
+ it 'does not hit the external authorization service' do
+ expect(::Gitlab::ExternalAuthorization).not_to receive(:access_allowed?)
+
+ expect(json[:can_edit]).to eq(false)
+ end
+ end
end