summaryrefslogtreecommitdiff
path: root/spec/workers/repository_check
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-03-27 16:42:08 -0400
committerRobert Speicher <rspeicher@gmail.com>2017-03-27 18:45:37 -0400
commit68e671893247326a28fc3e5d139ae2c3060e628c (patch)
treea005e651f8109ca6d653a624dbdf3a2a05e9a438 /spec/workers/repository_check
parent985a0c39ef29db3c3c2c3aa386b2d332d9e98018 (diff)
downloadgitlab-ce-68e671893247326a28fc3e5d139ae2c3060e628c.tar.gz
Use `:empty_project` where possible in worker specs
Diffstat (limited to 'spec/workers/repository_check')
-rw-r--r--spec/workers/repository_check/batch_worker_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/workers/repository_check/batch_worker_spec.rb b/spec/workers/repository_check/batch_worker_spec.rb
index 27727d6abf9..bcd97a4f6ef 100644
--- a/spec/workers/repository_check/batch_worker_spec.rb
+++ b/spec/workers/repository_check/batch_worker_spec.rb
@@ -4,7 +4,7 @@ describe RepositoryCheck::BatchWorker do
subject { described_class.new }
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[2].update_column(:last_repository_check_at, 3.months.ago)
@@ -12,7 +12,7 @@ describe RepositoryCheck::BatchWorker do
end
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[1].update_column(:last_repository_check_at, 4.months.ago)
projects[2].update_column(:last_repository_check_at, 3.months.ago)
@@ -21,7 +21,7 @@ describe RepositoryCheck::BatchWorker do
end
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[1].update_column(:last_repository_check_at, 2.months.ago)
projects[2].update_column(:last_repository_check_at, 3.days.ago)
@@ -40,7 +40,7 @@ describe RepositoryCheck::BatchWorker do
it 'skips projects created less than 24 hours ago' do
project = create(:empty_project)
project.update_column(:created_at, 23.hours.ago)
-
+
expect(subject.perform).to eq([])
end
end