Sha256: 805617bb43fd7923a3ddaff6ac9582821e0130015ec36a70b99027cdec3e8f5f

Contents?: true

Size: 734 Bytes

Versions: 5

Compression:

Stored size: 734 Bytes

Contents

require 'spec_helper'

describe CharacterizeJob do
  before do
    allow_any_instance_of(GenericFile).to receive(:reload_on_save?).and_return(false)
    # Don't actually create the derivatives -- that is tested elsewhere
    allow_any_instance_of(GenericFile).to receive(:create_derivatives)
    @generic_file = GenericFile.create do |gf|
      gf.apply_depositor_metadata('jcoyne@example.com')
      gf.add_file(File.open(fixture_path + '/charter.docx'), path: 'content', original_name: 'charter.docx')
    end
  end

  subject { CharacterizeJob.new(@generic_file.id)}

  it 'spawns a CreateDerivatives job' do
    expect(CreateDerivativesJob).to receive(:new).with(@generic_file.id).once.and_call_original
    subject.run
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sufia-6.2.0 spec/jobs/characterize_job_spec.rb
sufia-6.1.0 spec/jobs/characterize_job_spec.rb
sufia-6.0.0 spec/jobs/characterize_job_spec.rb
sufia-6.0.0.rc4 spec/jobs/characterize_job_spec.rb
sufia-6.0.0.rc3 spec/jobs/characterize_job_spec.rb