Commit 54e18d28 authored by James Lopez's avatar James Lopez

add project saver spec and fix

parent fd0b838b
...@@ -8,6 +8,7 @@ module EE ...@@ -8,6 +8,7 @@ module EE
prepended do prepended do
include Elastic::ProjectsSearch include Elastic::ProjectsSearch
include Importable
prepend GeoAwareAvatar prepend GeoAwareAvatar
prepend ImportStatusStateMachine prepend ImportStatusStateMachine
...@@ -53,7 +54,7 @@ module EE ...@@ -53,7 +54,7 @@ module EE
validates :repository_size_limit, validates :repository_size_limit,
numericality: { only_integer: true, greater_than_or_equal_to: 0, allow_nil: true } numericality: { only_integer: true, greater_than_or_equal_to: 0, allow_nil: true }
validates :approvals_before_merge, numericality: true, allow_blank: true validates :approvals_before_merge, numericality: true, allow_blank: true, unless: :importing?
accepts_nested_attributes_for :remote_mirrors, accepts_nested_attributes_for :remote_mirrors,
allow_destroy: true, allow_destroy: true,
......
...@@ -33,6 +33,10 @@ describe Gitlab::ImportExport::ProjectTreeSaver do ...@@ -33,6 +33,10 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
expect(saved_project_json).to include({ "visibility_level" => 20 }) expect(saved_project_json).to include({ "visibility_level" => 20 })
end end
it 'has approvals_before_merge set' do
expect(saved_project_json['approvals_before_merge']).to eq(1)
end
it 'has milestones' do it 'has milestones' do
expect(saved_project_json['milestones']).not_to be_empty expect(saved_project_json['milestones']).not_to be_empty
end end
...@@ -241,7 +245,8 @@ describe Gitlab::ImportExport::ProjectTreeSaver do ...@@ -241,7 +245,8 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
issues: [issue], issues: [issue],
snippets: [snippet], snippets: [snippet],
releases: [release], releases: [release],
group: group group: group,
approvals_before_merge: 1
) )
project.update_column(:description_html, 'description') project.update_column(:description_html, 'description')
project_label = create(:label, project: project) project_label = create(:label, project: project)
......
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