BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6f152fd1
Unverified
Commit
6f152fd1
authored
Mar 01, 2018
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update specs to respect Project#namespace_id not null constraint
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
f9e0c907
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
6 deletions
+11
-6
cleanup_namespaceless_pending_delete_projects_spec.rb
...ons/cleanup_namespaceless_pending_delete_projects_spec.rb
+1
-1
migrate_issues_to_ghost_user_spec.rb
spec/migrations/migrate_issues_to_ghost_user_spec.rb
+1
-1
project_spec.rb
spec/models/project_spec.rb
+6
-3
namespaceless_project_destroy_worker_spec.rb
spec/workers/namespaceless_project_destroy_worker_spec.rb
+3
-1
No files found.
spec/migrations/cleanup_namespaceless_pending_delete_projects_spec.rb
View file @
6f152fd1
require
'spec_helper'
require
Rails
.
root
.
join
(
'db'
,
'post_migrate'
,
'20170502101023_cleanup_namespaceless_pending_delete_projects.rb'
)
describe
CleanupNamespacelessPendingDeleteProjects
do
describe
CleanupNamespacelessPendingDeleteProjects
,
:migration
,
schema:
20180222043024
do
before
do
# Stub after_save callbacks that will fail when Project has no namespace
allow_any_instance_of
(
Project
).
to
receive
(
:ensure_storage_path_exists
).
and_return
(
nil
)
...
...
spec/migrations/migrate_issues_to_ghost_user_spec.rb
View file @
6f152fd1
...
...
@@ -8,7 +8,7 @@ describe MigrateIssuesToGhostUser, :migration do
let
(
:users
)
{
table
(
:users
)
}
before
do
project
=
projects
.
create!
(
name:
'gitlab'
)
project
=
projects
.
create!
(
name:
'gitlab'
,
namespace_id:
1
)
user
=
users
.
create
(
email:
'test@example.com'
)
issues
.
create
(
title:
'Issue 1'
,
author_id:
nil
,
project_id:
project
.
id
)
issues
.
create
(
title:
'Issue 2'
,
author_id:
user
.
id
,
project_id:
project
.
id
)
...
...
spec/models/project_spec.rb
View file @
6f152fd1
...
...
@@ -2499,7 +2499,8 @@ describe Project do
end
it
'is a no-op when there is no namespace'
do
project
.
update_column
(
:namespace_id
,
nil
)
project
.
namespace
.
delete
project
.
reload
expect_any_instance_of
(
Projects
::
UpdatePagesConfigurationService
).
not_to
receive
(
:execute
)
expect_any_instance_of
(
Gitlab
::
PagesTransfer
).
not_to
receive
(
:rename_project
)
...
...
@@ -2531,7 +2532,8 @@ describe Project do
it
'is a no-op on legacy projects when there is no namespace'
do
export_path
=
legacy_project
.
export_path
legacy_project
.
update_column
(
:namespace_id
,
nil
)
legacy_project
.
namespace
.
delete
legacy_project
.
reload
expect
(
FileUtils
).
not_to
receive
(
:rm_rf
).
with
(
export_path
)
...
...
@@ -2543,7 +2545,8 @@ describe Project do
it
'runs on hashed storage projects when there is no namespace'
do
export_path
=
project
.
export_path
project
.
update_column
(
:namespace_id
,
nil
)
project
.
namespace
.
delete
legacy_project
.
reload
allow
(
FileUtils
).
to
receive
(
:rm_rf
).
and_call_original
expect
(
FileUtils
).
to
receive
(
:rm_rf
).
with
(
export_path
).
and_call_original
...
...
spec/workers/namespaceless_project_destroy_worker_spec.rb
View file @
6f152fd1
...
...
@@ -22,7 +22,9 @@ describe NamespacelessProjectDestroyWorker do
end
end
context
'project has no namespace'
do
# Only possible with schema 20180222043024 and lower.
# Project#namespace_id has not null constraint since then
context
'project has no namespace'
,
:migration
,
schema:
20180222043024
do
let!
(
:project
)
do
project
=
build
(
:project
,
namespace_id:
nil
)
project
.
save
(
validate:
false
)
...
...
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