Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
54e18d28
Commit
54e18d28
authored
Aug 25, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add project saver spec and fix
parent
fd0b838b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+2
-1
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
+6
-1
No files found.
ee/app/models/ee/project.rb
View file @
54e18d28
...
@@ -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
,
...
...
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
View file @
54e18d28
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment