diff options
Diffstat (limited to 'spec/lib')
5 files changed, 39 insertions, 2 deletions
diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index 96efdd0949b..50786ac6324 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -286,6 +286,7 @@ project: - root_of_fork_network - fork_network_member - fork_network +- custom_attributes award_emoji: - awardable - user diff --git a/spec/lib/gitlab/import_export/project.json b/spec/lib/gitlab/import_export/project.json index 9a68bbb379c..f7c90093bde 100644 --- a/spec/lib/gitlab/import_export/project.json +++ b/spec/lib/gitlab/import_export/project.json @@ -7408,5 +7408,23 @@ "snippets_access_level": 20, "updated_at": "2016-09-23T11:58:28.000Z", "wiki_access_level": 20 - } + }, + "custom_attributes": [ + { + "id": 1, + "created_at": "2017-10-19T15:36:23.466Z", + "updated_at": "2017-10-19T15:36:23.466Z", + "project_id": 5, + "key": "foo", + "value": "foo" + }, + { + "id": 2, + "created_at": "2017-10-19T15:37:21.904Z", + "updated_at": "2017-10-19T15:37:21.904Z", + "project_id": 5, + "key": "bar", + "value": "bar" + } + ] } 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 76b01b6a1ec..e4b4cf5ba85 100644 --- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb @@ -133,6 +133,10 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do expect(@project.project_feature).not_to be_nil end + it 'has custom attributes' do + expect(@project.custom_attributes.count).to eq(2) + end + it 'restores the correct service' do expect(CustomIssueTrackerService.first).not_to be_nil end diff --git a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb index 8da768ebd07..ee173afbd50 100644 --- a/spec/lib/gitlab/import_export/project_tree_saver_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_saver_spec.rb @@ -168,6 +168,10 @@ describe Gitlab::ImportExport::ProjectTreeSaver do expect(project_feature["builds_access_level"]).to eq(ProjectFeature::PRIVATE) end + it 'has custom attributes' do + expect(saved_project_json['custom_attributes'].count).to eq(2) + end + it 'does not complain about non UTF-8 characters in MR diffs' do ActiveRecord::Base.connection.execute("UPDATE merge_request_diffs SET st_diffs = '---\n- :diff: !binary |-\n LS0tIC9kZXYvbnVsbAorKysgYi9pbWFnZXMvbnVjb3IucGRmCkBAIC0wLDAg\n KzEsMTY3OSBAQAorJVBERi0xLjUNJeLjz9MNCisxIDAgb2JqDTw8L01ldGFk\n YXR'") @@ -279,6 +283,9 @@ describe Gitlab::ImportExport::ProjectTreeSaver do create(:event, :created, target: milestone, project: project, author: user) create(:service, project: project, type: 'CustomIssueTrackerService', category: 'issue_tracker') + create(:project_custom_attribute, project: project) + create(:project_custom_attribute, project: project) + project end diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml index 4b79e9f18c6..4e36af18aa7 100644 --- a/spec/lib/gitlab/import_export/safe_model_attributes.yml +++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml @@ -525,4 +525,11 @@ ProjectAutoDevops: - updated_at IssueAssignee: - user_id -- issue_id
\ No newline at end of file +- issue_id +ProjectCustomAttribute: +- id +- created_at +- updated_at +- project_id +- key +- value |