2017-11-08 23:05:08 +00:00
|
|
|
module TrackUntrackedUploadsHelpers
|
2017-11-15 07:15:30 +00:00
|
|
|
def uploaded_file
|
|
|
|
fixture_path = Rails.root.join('spec', 'fixtures', 'rails_sample.jpg')
|
|
|
|
fixture_file_upload(fixture_path)
|
2017-11-08 23:05:08 +00:00
|
|
|
end
|
2017-11-15 10:36:25 +00:00
|
|
|
|
2017-11-15 13:19:07 +00:00
|
|
|
def ensure_temporary_tracking_table_exists
|
|
|
|
Gitlab::BackgroundMigration::PrepareUntrackedUploads.new.send(:ensure_temporary_tracking_table_exists)
|
2017-11-15 10:36:25 +00:00
|
|
|
end
|
|
|
|
|
2017-11-15 13:19:07 +00:00
|
|
|
def drop_temp_table_if_exists
|
|
|
|
ActiveRecord::Base.connection.drop_table(:untracked_files_for_uploads) if ActiveRecord::Base.connection.table_exists?(:untracked_files_for_uploads)
|
2017-11-15 10:36:25 +00:00
|
|
|
end
|
2017-12-06 07:08:45 +00:00
|
|
|
|
|
|
|
def create_or_update_appearance(attrs)
|
|
|
|
a = Appearance.first_or_initialize(title: 'foo', description: 'bar')
|
|
|
|
a.update!(attrs)
|
|
|
|
a
|
|
|
|
end
|
2017-11-08 23:05:08 +00:00
|
|
|
end
|