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

add project saver spec and fix

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