Sha256: 050bff77472d6989edb9475589084c62dade517a073fe592ab19b95721e92d59

Contents?: true

Size: 889 Bytes

Versions: 3

Compression:

Stored size: 889 Bytes

Contents

require 'spec_helper'

describe TranscodeVideoJob do
  before do
    @generic_file = GenericFile.new(:terms_of_service=>'1')
    @generic_file.apply_depositor_metadata('jcoyne@example.com')
    @generic_file.add_file_datastream(File.new(fixture_path + '/countdown.avi'), :dsid=>'content')
    @generic_file.save!
  end

  after do
    @generic_file.delete
  end

  subject { TranscodeVideoJob.new(@generic_file.id, 'content')}
  it "should put content in datastream_out" do
    subject.run
    reloaded = GenericFile.find(@generic_file.pid)
    derivative = reloaded.datastreams['webm']
    derivative.should_not be_nil
    derivative.content.should_not be_nil
    derivative.mimeType.should == 'video/webm'

    derivative2 = reloaded.datastreams['mp4']
    derivative2.should_not be_nil
    derivative2.content.should_not be_nil
    derivative2.mimeType.should == 'video/mp4'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sufia-0.0.3 spec/models/transcode_video_job_spec.rb
sufia-0.0.2 spec/models/transcode_video_job_spec.rb
sufia-0.0.1 spec/models/transcode_video_job_spec.rb