diff --git a/app/services/tasks/samples_to_repository_migration_service.rb b/app/services/tasks/samples_to_repository_migration_service.rb index 1889a371a..0b15a6b65 100644 --- a/app/services/tasks/samples_to_repository_migration_service.rb +++ b/app/services/tasks/samples_to_repository_migration_service.rb @@ -173,6 +173,7 @@ module Tasks LEFT OUTER JOIN sample_groups ON samples.sample_group_id = sample_groups.id WHERE samples.team_id = #{team.id} + ORDER BY samples.id SQL ActiveRecord::Base.connection.execute(samples_sql).to_a diff --git a/config/initializers/kaminari_config.rb b/config/initializers/kaminari_config.rb index 373150f63..2dd4e31b8 100644 --- a/config/initializers/kaminari_config.rb +++ b/config/initializers/kaminari_config.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + Kaminari.configure do |config| config.default_per_page = 10 # config.max_per_page = nil diff --git a/spec/factories/users.rb b/spec/factories/users.rb index dcdd9a9cf..1e1c42b50 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -2,7 +2,7 @@ FactoryBot.define do factory :user do full_name 'admin' initials 'AD' - email 'admin_test@scinote.net' + email Faker::Internet.unique.email password 'asdf1243' password_confirmation 'asdf1243' current_sign_in_at DateTime.now diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 9e36e7828..79e319489 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -59,6 +59,18 @@ RSpec.configure do |config| DatabaseCleaner.clean end + config.before(:all) do + DatabaseCleaner.strategy = :transaction + end + + config.before(:all) do + DatabaseCleaner.start + end + + config.after(:all) do + DatabaseCleaner.clean + end + config.around(:each, type: :background_job) do |example| run_background_jobs_immediately do example.run