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
4f25ca25
Commit
4f25ca25
authored
Oct 09, 2017
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CE->EE merge: fix failing specs in spec/models/project_spec.rb
parent
b57f75ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
17 deletions
+10
-17
spec/models/project_spec.rb
spec/models/project_spec.rb
+10
-17
No files found.
spec/models/project_spec.rb
View file @
4f25ca25
...
@@ -2174,29 +2174,22 @@ describe Project do
...
@@ -2174,29 +2174,22 @@ describe Project do
end
end
describe
'#change_repository_storage'
do
describe
'#change_repository_storage'
do
let
(
:project
)
{
create
(
:project
,
:repository
,
repository_storage:
'a'
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:read_only_project
)
{
create
(
:project
,
:repository
,
repository_
storage:
'a'
,
repository_
read_only:
true
)
}
let
(
:read_only_project
)
{
create
(
:project
,
:repository
,
repository_read_only:
true
)
}
before
do
before
do
FileUtils
.
mkdir
(
'tmp/tests/storage_a'
)
FileUtils
.
mkdir
(
'tmp/tests/extra_storage'
)
FileUtils
.
mkdir
(
'tmp/tests/storage_b'
)
stub_storage_settings
(
'extra'
=>
{
'path'
=>
'tmp/tests/extra_storage'
})
storages
=
{
'a'
=>
{
'path'
=>
'tmp/tests/storage_a'
},
'b'
=>
{
'path'
=>
'tmp/tests/storage_b'
}
}
allow
(
Gitlab
.
config
.
repositories
).
to
receive
(
:storages
).
and_return
(
storages
)
end
end
after
do
after
do
FileUtils
.
rm_rf
(
'tmp/tests/storage_a'
)
FileUtils
.
rm_rf
(
'tmp/tests/extra_storage'
)
FileUtils
.
rm_rf
(
'tmp/tests/storage_b'
)
end
end
it
'schedule the transfer of the repository to the new storage and locks the project'
do
it
'schedule the transfer of the repository to the new storage and locks the project'
do
expect
(
ProjectUpdateRepositoryStorageWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
,
'
b
'
)
expect
(
ProjectUpdateRepositoryStorageWorker
).
to
receive
(
:perform_async
).
with
(
project
.
id
,
'
extra
'
)
project
.
change_repository_storage
(
'
b
'
)
project
.
change_repository_storage
(
'
extra
'
)
project
.
save
project
.
save
expect
(
project
).
to
be_repository_read_only
expect
(
project
).
to
be_repository_read_only
...
@@ -2205,21 +2198,21 @@ describe Project do
...
@@ -2205,21 +2198,21 @@ describe Project do
it
"doesn't schedule the transfer if the repository is already read-only"
do
it
"doesn't schedule the transfer if the repository is already read-only"
do
expect
(
ProjectUpdateRepositoryStorageWorker
).
not_to
receive
(
:perform_async
)
expect
(
ProjectUpdateRepositoryStorageWorker
).
not_to
receive
(
:perform_async
)
read_only_project
.
change_repository_storage
(
'
b
'
)
read_only_project
.
change_repository_storage
(
'
extra
'
)
read_only_project
.
save
read_only_project
.
save
end
end
it
"doesn't lock or schedule the transfer if the storage hasn't changed"
do
it
"doesn't lock or schedule the transfer if the storage hasn't changed"
do
expect
(
ProjectUpdateRepositoryStorageWorker
).
not_to
receive
(
:perform_async
)
expect
(
ProjectUpdateRepositoryStorageWorker
).
not_to
receive
(
:perform_async
)
project
.
change_repository_storage
(
'a'
)
project
.
change_repository_storage
(
project
.
repository_storage
)
project
.
save
project
.
save
expect
(
project
).
not_to
be_repository_read_only
expect
(
project
).
not_to
be_repository_read_only
end
end
it
'throws an error if an invalid repository storage is provided'
do
it
'throws an error if an invalid repository storage is provided'
do
expect
{
project
.
change_repository_storage
(
'
c'
)
}.
to
raise_error
expect
{
project
.
change_repository_storage
(
'
unknown'
)
}.
to
raise_error
(
ArgumentError
)
end
end
end
end
...
...
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