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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
68e67189
Commit
68e67189
authored
Mar 27, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `:empty_project` where possible in worker specs
parent
985a0c39
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
18 additions
and
18 deletions
+18
-18
spec/workers/delete_merged_branches_worker_spec.rb
spec/workers/delete_merged_branches_worker_spec.rb
+1
-1
spec/workers/emails_on_push_worker_spec.rb
spec/workers/emails_on_push_worker_spec.rb
+1
-1
spec/workers/git_garbage_collect_worker_spec.rb
spec/workers/git_garbage_collect_worker_spec.rb
+1
-1
spec/workers/group_destroy_worker_spec.rb
spec/workers/group_destroy_worker_spec.rb
+1
-1
spec/workers/pipeline_metrics_worker_spec.rb
spec/workers/pipeline_metrics_worker_spec.rb
+1
-1
spec/workers/pipeline_notification_worker_spec.rb
spec/workers/pipeline_notification_worker_spec.rb
+1
-1
spec/workers/post_receive_spec.rb
spec/workers/post_receive_spec.rb
+1
-1
spec/workers/process_commit_worker_spec.rb
spec/workers/process_commit_worker_spec.rb
+1
-1
spec/workers/project_cache_worker_spec.rb
spec/workers/project_cache_worker_spec.rb
+1
-1
spec/workers/project_destroy_worker_spec.rb
spec/workers/project_destroy_worker_spec.rb
+1
-1
spec/workers/repository_check/batch_worker_spec.rb
spec/workers/repository_check/batch_worker_spec.rb
+4
-4
spec/workers/repository_fork_worker_spec.rb
spec/workers/repository_fork_worker_spec.rb
+2
-2
spec/workers/repository_import_worker_spec.rb
spec/workers/repository_import_worker_spec.rb
+1
-1
spec/workers/update_merge_requests_worker_spec.rb
spec/workers/update_merge_requests_worker_spec.rb
+1
-1
No files found.
spec/workers/delete_merged_branches_worker_spec.rb
View file @
68e67189
...
@@ -3,7 +3,7 @@ require 'spec_helper'
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
DeleteMergedBranchesWorker
do
describe
DeleteMergedBranchesWorker
do
subject
(
:worker
)
{
described_class
.
new
}
subject
(
:worker
)
{
described_class
.
new
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
describe
"#perform"
do
describe
"#perform"
do
it
"calls DeleteMergedBranchesService"
do
it
"calls DeleteMergedBranchesService"
do
...
...
spec/workers/emails_on_push_worker_spec.rb
View file @
68e67189
...
@@ -5,7 +5,7 @@ describe EmailsOnPushWorker do
...
@@ -5,7 +5,7 @@ describe EmailsOnPushWorker do
include
EmailHelpers
include
EmailHelpers
include
EmailSpec
::
Matchers
include
EmailSpec
::
Matchers
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:data
)
{
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
}
let
(
:data
)
{
Gitlab
::
DataBuilder
::
Push
.
build_sample
(
project
,
user
)
}
let
(
:recipients
)
{
user
.
email
}
let
(
:recipients
)
{
user
.
email
}
...
...
spec/workers/git_garbage_collect_worker_spec.rb
View file @
68e67189
...
@@ -3,7 +3,7 @@ require 'fileutils'
...
@@ -3,7 +3,7 @@ require 'fileutils'
require
'spec_helper'
require
'spec_helper'
describe
GitGarbageCollectWorker
do
describe
GitGarbageCollectWorker
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:shell
)
{
Gitlab
::
Shell
.
new
}
let
(
:shell
)
{
Gitlab
::
Shell
.
new
}
subject
{
GitGarbageCollectWorker
.
new
}
subject
{
GitGarbageCollectWorker
.
new
}
...
...
spec/workers/group_destroy_worker_spec.rb
View file @
68e67189
...
@@ -3,7 +3,7 @@ require 'spec_helper'
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
GroupDestroyWorker
do
describe
GroupDestroyWorker
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:user
)
{
create
(
:admin
)
}
let
(
:user
)
{
create
(
:admin
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let!
(
:project
)
{
create
(
:
empty_
project
,
namespace:
group
)
}
subject
{
GroupDestroyWorker
.
new
}
subject
{
GroupDestroyWorker
.
new
}
...
...
spec/workers/pipeline_metrics_worker_spec.rb
View file @
68e67189
require
'spec_helper'
require
'spec_helper'
describe
PipelineMetricsWorker
do
describe
PipelineMetricsWorker
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
source_branch:
pipeline
.
ref
)
}
let!
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
source_branch:
pipeline
.
ref
)
}
let
(
:pipeline
)
do
let
(
:pipeline
)
do
...
...
spec/workers/pipeline_notification_worker_spec.rb
View file @
68e67189
...
@@ -11,7 +11,7 @@ describe PipelineNotificationWorker do
...
@@ -11,7 +11,7 @@ describe PipelineNotificationWorker do
status:
status
)
status:
status
)
end
end
let
(
:project
)
{
create
(
:project
,
public_builds:
false
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
public_builds:
false
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:pusher
)
{
user
}
let
(
:pusher
)
{
user
}
let
(
:watcher
)
{
pusher
}
let
(
:watcher
)
{
pusher
}
...
...
spec/workers/post_receive_spec.rb
View file @
68e67189
...
@@ -4,7 +4,7 @@ describe PostReceive do
...
@@ -4,7 +4,7 @@ describe PostReceive do
let
(
:changes
)
{
"123456 789012 refs/heads/tést
\n
654321 210987 refs/tags/tag"
}
let
(
:changes
)
{
"123456 789012 refs/heads/tést
\n
654321 210987 refs/tags/tag"
}
let
(
:wrongly_encoded_changes
)
{
changes
.
encode
(
"ISO-8859-1"
).
force_encoding
(
"UTF-8"
)
}
let
(
:wrongly_encoded_changes
)
{
changes
.
encode
(
"ISO-8859-1"
).
force_encoding
(
"UTF-8"
)
}
let
(
:base64_changes
)
{
Base64
.
encode64
(
wrongly_encoded_changes
)
}
let
(
:base64_changes
)
{
Base64
.
encode64
(
wrongly_encoded_changes
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:key
)
{
create
(
:key
,
user:
project
.
owner
)
}
let
(
:key
)
{
create
(
:key
,
user:
project
.
owner
)
}
let
(
:key_id
)
{
key
.
shell_id
}
let
(
:key_id
)
{
key
.
shell_id
}
...
...
spec/workers/process_commit_worker_spec.rb
View file @
68e67189
...
@@ -3,7 +3,7 @@ require 'spec_helper'
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
ProcessCommitWorker
do
describe
ProcessCommitWorker
do
let
(
:worker
)
{
described_class
.
new
}
let
(
:worker
)
{
described_class
.
new
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
user
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
user
)
}
let
(
:commit
)
{
project
.
commit
}
let
(
:commit
)
{
project
.
commit
}
...
...
spec/workers/project_cache_worker_spec.rb
View file @
68e67189
...
@@ -2,7 +2,7 @@ require 'spec_helper'
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
ProjectCacheWorker
do
describe
ProjectCacheWorker
do
let
(
:worker
)
{
described_class
.
new
}
let
(
:worker
)
{
described_class
.
new
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:statistics
)
{
project
.
statistics
}
let
(
:statistics
)
{
project
.
statistics
}
describe
'#perform'
do
describe
'#perform'
do
...
...
spec/workers/project_destroy_worker_spec.rb
View file @
68e67189
require
'spec_helper'
require
'spec_helper'
describe
ProjectDestroyWorker
do
describe
ProjectDestroyWorker
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:path
)
{
project
.
repository
.
path_to_repo
}
let
(
:path
)
{
project
.
repository
.
path_to_repo
}
subject
{
ProjectDestroyWorker
.
new
}
subject
{
ProjectDestroyWorker
.
new
}
...
...
spec/workers/repository_check/batch_worker_spec.rb
View file @
68e67189
...
@@ -4,7 +4,7 @@ describe RepositoryCheck::BatchWorker do
...
@@ -4,7 +4,7 @@ describe RepositoryCheck::BatchWorker do
subject
{
described_class
.
new
}
subject
{
described_class
.
new
}
it
'prefers projects that have never been checked'
do
it
'prefers projects that have never been checked'
do
projects
=
create_list
(
:project
,
3
,
created_at:
1
.
week
.
ago
)
projects
=
create_list
(
:
empty_
project
,
3
,
created_at:
1
.
week
.
ago
)
projects
[
0
].
update_column
(
:last_repository_check_at
,
4
.
months
.
ago
)
projects
[
0
].
update_column
(
:last_repository_check_at
,
4
.
months
.
ago
)
projects
[
2
].
update_column
(
:last_repository_check_at
,
3
.
months
.
ago
)
projects
[
2
].
update_column
(
:last_repository_check_at
,
3
.
months
.
ago
)
...
@@ -12,7 +12,7 @@ describe RepositoryCheck::BatchWorker do
...
@@ -12,7 +12,7 @@ describe RepositoryCheck::BatchWorker do
end
end
it
'sorts projects by last_repository_check_at'
do
it
'sorts projects by last_repository_check_at'
do
projects
=
create_list
(
:project
,
3
,
created_at:
1
.
week
.
ago
)
projects
=
create_list
(
:
empty_
project
,
3
,
created_at:
1
.
week
.
ago
)
projects
[
0
].
update_column
(
:last_repository_check_at
,
2
.
months
.
ago
)
projects
[
0
].
update_column
(
:last_repository_check_at
,
2
.
months
.
ago
)
projects
[
1
].
update_column
(
:last_repository_check_at
,
4
.
months
.
ago
)
projects
[
1
].
update_column
(
:last_repository_check_at
,
4
.
months
.
ago
)
projects
[
2
].
update_column
(
:last_repository_check_at
,
3
.
months
.
ago
)
projects
[
2
].
update_column
(
:last_repository_check_at
,
3
.
months
.
ago
)
...
@@ -21,7 +21,7 @@ describe RepositoryCheck::BatchWorker do
...
@@ -21,7 +21,7 @@ describe RepositoryCheck::BatchWorker do
end
end
it
'excludes projects that were checked recently'
do
it
'excludes projects that were checked recently'
do
projects
=
create_list
(
:project
,
3
,
created_at:
1
.
week
.
ago
)
projects
=
create_list
(
:
empty_
project
,
3
,
created_at:
1
.
week
.
ago
)
projects
[
0
].
update_column
(
:last_repository_check_at
,
2
.
days
.
ago
)
projects
[
0
].
update_column
(
:last_repository_check_at
,
2
.
days
.
ago
)
projects
[
1
].
update_column
(
:last_repository_check_at
,
2
.
months
.
ago
)
projects
[
1
].
update_column
(
:last_repository_check_at
,
2
.
months
.
ago
)
projects
[
2
].
update_column
(
:last_repository_check_at
,
3
.
days
.
ago
)
projects
[
2
].
update_column
(
:last_repository_check_at
,
3
.
days
.
ago
)
...
...
spec/workers/repository_fork_worker_spec.rb
View file @
68e67189
require
'spec_helper'
require
'spec_helper'
describe
RepositoryForkWorker
do
describe
RepositoryForkWorker
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
)
}
let
(
:fork_project
)
{
create
(
:project
,
:repository
,
forked_from_project:
project
)
}
let
(
:shell
)
{
Gitlab
::
Shell
.
new
}
let
(
:shell
)
{
Gitlab
::
Shell
.
new
}
subject
{
RepositoryForkWorker
.
new
}
subject
{
RepositoryForkWorker
.
new
}
...
...
spec/workers/repository_import_worker_spec.rb
View file @
68e67189
require
'spec_helper'
require
'spec_helper'
describe
RepositoryImportWorker
do
describe
RepositoryImportWorker
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
subject
{
described_class
.
new
}
subject
{
described_class
.
new
}
...
...
spec/workers/update_merge_requests_worker_spec.rb
View file @
68e67189
...
@@ -3,7 +3,7 @@ require 'spec_helper'
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
UpdateMergeRequestsWorker
do
describe
UpdateMergeRequestsWorker
do
include
RepoHelpers
include
RepoHelpers
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
subject
{
described_class
.
new
}
subject
{
described_class
.
new
}
...
...
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