Commit ddd4b3af authored by Aleksei Lipniagov's avatar Aleksei Lipniagov

Fix ci_cd_settings Import, project_feature spec

parent 7f1f1bd7
......@@ -327,7 +327,12 @@ module Gitlab
end
def find_or_create_object!
return relation_class.find_or_create_by(project_id: @project.id) if UNIQUE_RELATIONS.include?(@relation_name)
if UNIQUE_RELATIONS.include?(@relation_name)
unique_relation_object = relation_class.find_or_create_by(project_id: @project.id)
unique_relation_object.assign_attributes(parsed_relation_hash)
return unique_relation_object
end
# Can't use IDs as validation exists calling `group` or `project` attributes
finder_hash = parsed_relation_hash.tap do |hash|
......
......@@ -7209,7 +7209,7 @@
}
],
"project_feature": {
"builds_access_level": 0,
"builds_access_level": 20,
"created_at": "2014-12-26T09:26:45.000Z",
"id": 2,
"issues_access_level": 0,
......@@ -7257,6 +7257,9 @@
"image_url": "http://www.example.com"
}
],
"ci_cd_settings": {
"group_runners_enabled": false
},
"boards": [
{
"id": 29,
......
......@@ -220,6 +220,10 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
expect(award_emoji.map(&:name)).to contain_exactly('thumbsup', 'coffee')
end
it 'restores `ci_cd_settings` : `group_runners_enabled` setting' do
expect(@project.ci_cd_settings.group_runners_enabled?).to eq(false)
end
it 'restores the correct service' do
expect(CustomIssueTrackerService.first).not_to be_nil
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment