summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-11-26 20:57:51 -0800
committerMichael Kozono <mkozono@gmail.com>2017-12-01 15:26:42 -0800
commitdd4b35f864e43b94532c2229e0135eaa47ddc9fe (patch)
tree295e6d2fa0567126f3e798dc02459b8311066337
parente5cf23dfcf22f5a82ec027212d0a178894ea2396 (diff)
downloadgitlab-ce-dd4b35f864e43b94532c2229e0135eaa47ddc9fe.tar.gz
Fix test for MySQL
-rw-r--r--spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb b/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
index 85da8ac5b1e..7c69755c4cf 100644
--- a/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
+++ b/spec/lib/gitlab/background_migration/populate_untracked_uploads_spec.rb
@@ -71,8 +71,9 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid
end
it 'uses the start and end batch ids [only 1st half]' do
- start_id = untracked_files_for_uploads.all.to_a[0].id
- end_id = untracked_files_for_uploads.all.to_a[3].id
+ ids = untracked_files_for_uploads.all.order(:id).pluck(:id)
+ start_id = ids[0]
+ end_id = ids[3]
expect do
subject.perform(start_id, end_id)
@@ -89,8 +90,9 @@ describe Gitlab::BackgroundMigration::PopulateUntrackedUploads, :migration, :sid
end
it 'uses the start and end batch ids [only 2nd half]' do
- start_id = untracked_files_for_uploads.all.to_a[4].id
- end_id = untracked_files_for_uploads.all.to_a[7].id
+ ids = untracked_files_for_uploads.all.order(:id).pluck(:id)
+ start_id = ids[4]
+ end_id = ids[7]
expect do
subject.perform(start_id, end_id)