2017-11-08 18:05:08 -05:00
|
|
|
module TrackUntrackedUploadsHelpers
|
2017-11-15 02:15:30 -05:00
|
|
|
def uploaded_file
|
|
|
|
fixture_path = Rails.root.join('spec', 'fixtures', 'rails_sample.jpg')
|
|
|
|
fixture_file_upload(fixture_path)
|
2017-11-08 18:05:08 -05:00
|
|
|
end
|
2017-11-15 05:36:25 -05:00
|
|
|
|
2017-11-15 08:19:07 -05:00
|
|
|
def ensure_temporary_tracking_table_exists
|
|
|
|
Gitlab::BackgroundMigration::PrepareUntrackedUploads.new.send(:ensure_temporary_tracking_table_exists)
|
2017-11-15 05:36:25 -05:00
|
|
|
end
|
|
|
|
|
2017-11-15 08:19:07 -05: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 05:36:25 -05:00
|
|
|
end
|
2017-12-06 02:08:45 -05:00
|
|
|
|
|
|
|
def create_or_update_appearance(attrs)
|
|
|
|
a = Appearance.first_or_initialize(title: 'foo', description: 'bar')
|
|
|
|
a.update!(attrs)
|
|
|
|
a
|
|
|
|
end
|
2017-11-08 18:05:08 -05:00
|
|
|
end
|