Sha256: 349eced9876f0e989153eda4ade5aa79e2a7bdb58d411f55b14524791dc71c49

Contents?: true

Size: 959 Bytes

Versions: 5

Compression:

Stored size: 959 Bytes

Contents

require 'spec_helper'

describe "#audit_trail" do

  before do
    path = File.join(File.dirname(__FILE__), 'fixtures', 'audit_trail.foxml.xml')
    File.open(path, 'rb') do |f|
      @xml = f.read
    end
    @repo = Rubydora::Repository.new
    @repo.api.stub(:object_xml).with(hash_including(:pid => 'foo:bar')).and_return(@xml)
    @test_object = Rubydora::DigitalObject.new('foo:bar', @repo)
  end
  it "should have the correct number of audit records" do
    @test_object.audit_trail.records.length.should == 3
  end
  it "should return all the data from each audit record" do
    record = @test_object.audit_trail.records.first
    record.id.should == "AUDREC1"
    record.process_type.should == "Fedora API-M"
    record.action.should == "addDatastream"
    record.component_id.should == "RELS-EXT"
    record.responsibility.should == "fedoraAdmin"
    record.date.should == "2013-02-25T16:43:06.219Z"
    record.justification.should == ""
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubydora-2.2.0 spec/audit_trail_spec.rb
rubydora-2.1.0 spec/audit_trail_spec.rb
rubydora-2.0.0 spec/audit_trail_spec.rb
rubydora-1.9.1 spec/audit_trail_spec.rb
rubydora-1.9.0 spec/audit_trail_spec.rb