Sha256: 7453ea82f76852bfd890f64f38ed3e99b0538ae318c8ab46cca299511462bcc7

Contents?: true

Size: 677 Bytes

Versions: 7

Compression:

Stored size: 677 Bytes

Contents

require "spec_helper"

class ExtractThing < ActiveFedora::File
  include Hydra::Derivatives::ExtractMetadata
  attr_accessor :pid
end

describe Hydra::Derivatives::ExtractMetadata, :unless => $in_travis do
  let(:subject) { ExtractThing.new('http://example.com/foo') }
  let(:attachment) { File.open(File.expand_path('../../fixtures/world.png', __FILE__))}

  describe "Image Content" do
    it "should get a mime type" do
      subject.content = attachment
      subject.pid = "abc"
      xml = subject.extract_metadata
      doc = Nokogiri::HTML(xml)
      identity = doc.xpath('//identity').first
      expect(identity.attr('mimetype')).to eq('image/png')
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hydra-derivatives-1.2.1 spec/units/extract_spec.rb
hydra-derivatives-1.2.0 spec/units/extract_spec.rb
hydra-derivatives-2.0.0 spec/units/extract_spec.rb
hydra-derivatives-1.1.0 spec/units/extract_spec.rb
hydra-derivatives-1.0.0 spec/units/extract_spec.rb
hydra-derivatives-1.0.0.rc1 spec/units/extract_spec.rb
hydra-derivatives-1.0.0.beta1 spec/units/extract_spec.rb