summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/import_export
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-04-07 15:43:28 +0000
committerDouwe Maan <douwe@gitlab.com>2017-04-07 15:43:28 +0000
commit46aadc5c16150446840a26ea7199380830369326 (patch)
treefd41b11d20b3c6589b01d4500ad234d3582b5379 /spec/lib/gitlab/import_export
parent2d246df57dd8e7da8c2743fba38d31992bc7a3fc (diff)
parent6f15e89a6b83dcfef897dda414325b85090e2c40 (diff)
downloadgitlab-ce-46aadc5c16150446840a26ea7199380830369326.tar.gz
Merge branch '18471-restrict-tag-pushes-protected-tags' into 'master'
Protected Tags Closes #18471 See merge request !10356
Diffstat (limited to 'spec/lib/gitlab/import_export')
-rw-r--r--spec/lib/gitlab/import_export/all_models.yml6
-rw-r--r--spec/lib/gitlab/import_export/project.json18
-rw-r--r--spec/lib/gitlab/import_export/project_tree_restorer_spec.rb4
-rw-r--r--spec/lib/gitlab/import_export/safe_model_attributes.yml14
4 files changed, 42 insertions, 0 deletions
diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml
index 9770d2e3b13..0abf89d060c 100644
--- a/spec/lib/gitlab/import_export/all_models.yml
+++ b/spec/lib/gitlab/import_export/all_models.yml
@@ -124,10 +124,15 @@ protected_branches:
- project
- merge_access_levels
- push_access_levels
+protected_tags:
+- project
+- create_access_levels
merge_access_levels:
- protected_branch
push_access_levels:
- protected_branch
+create_access_levels:
+- protected_tag
container_repositories:
- project
- name
@@ -188,6 +193,7 @@ project:
- snippets
- hooks
- protected_branches
+- protected_tags
- project_members
- users
- requesters
diff --git a/spec/lib/gitlab/import_export/project.json b/spec/lib/gitlab/import_export/project.json
index d9b67426818..7a0b0b06d4b 100644
--- a/spec/lib/gitlab/import_export/project.json
+++ b/spec/lib/gitlab/import_export/project.json
@@ -7455,6 +7455,24 @@
]
}
],
+ "protected_tags": [
+ {
+ "id": 1,
+ "project_id": 9,
+ "name": "v*",
+ "created_at": "2017-04-04T13:48:13.426Z",
+ "updated_at": "2017-04-04T13:48:13.426Z",
+ "create_access_levels": [
+ {
+ "id": 1,
+ "protected_tag_id": 1,
+ "access_level": 40,
+ "created_at": "2017-04-04T13:48:13.458Z",
+ "updated_at": "2017-04-04T13:48:13.458Z"
+ }
+ ]
+ }
+ ],
"project_feature": {
"builds_access_level": 0,
"created_at": "2014-12-26T09:26:45.000Z",
diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
index af9c25acb02..0e9607c5bd3 100644
--- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
@@ -64,6 +64,10 @@ describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do
expect(ProtectedBranch.first.push_access_levels).not_to be_empty
end
+ it 'contains the create access levels on a protected tag' do
+ expect(ProtectedTag.first.create_access_levels).not_to be_empty
+ end
+
context 'event at forth level of the tree' do
let(:event) { Event.where(title: 'test levels').first }
diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml
index 04b5c80f22d..db5bc7e928a 100644
--- a/spec/lib/gitlab/import_export/safe_model_attributes.yml
+++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml
@@ -313,6 +313,12 @@ ProtectedBranch:
- name
- created_at
- updated_at
+ProtectedTag:
+- id
+- project_id
+- name
+- created_at
+- updated_at
Project:
- description
- issues_enabled
@@ -346,6 +352,14 @@ ProtectedBranch::PushAccessLevel:
- access_level
- created_at
- updated_at
+ProtectedTag::CreateAccessLevel:
+- id
+- protected_tag_id
+- access_level
+- created_at
+- updated_at
+- user_id
+- group_id
AwardEmoji:
- id
- user_id