Sha256: 985b205a2e4d330bf2a82a560a8ba59f5e8fea25a481182eb38fe00a78b05e2f

Contents?: true

Size: 881 Bytes

Versions: 22

Compression:

Stored size: 881 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::Auditable do

  before(:all) do
    class AuditableModel < ActiveFedora::Base
      include ActiveFedora::Auditable
    end
    @test_object = AuditableModel.create
    @test_object.reload
  end
  after(:all) do
    @test_object.delete
  end
  it "should have the correct number of audit records" do
    @test_object.audit_trail.records.length.should == 1
  end
  it "should return all the data from each audit record" do
    record = @test_object.audit_trail.records.last
    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"
    expect(DateTime.parse(record.date)).to eq DateTime.parse(@test_object.modified_date)
    record.justification.should == ""
  end
  
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
active-fedora-7.3.1 spec/integration/auditable_spec.rb
active-fedora-7.3.0 spec/integration/auditable_spec.rb
active-fedora-8.2.1 spec/integration/auditable_spec.rb
active-fedora-8.2.0 spec/integration/auditable_spec.rb
active-fedora-7.2.0 spec/integration/auditable_spec.rb
active-fedora-8.1.0 spec/integration/auditable_spec.rb
active-fedora-8.0.1 spec/integration/auditable_spec.rb
active-fedora-8.0.0 spec/integration/auditable_spec.rb
active-fedora-8.0.0.rc3 spec/integration/auditable_spec.rb
active-fedora-8.0.0.rc2 spec/integration/auditable_spec.rb
active-fedora-8.0.0.rc1 spec/integration/auditable_spec.rb
active-fedora-7.1.2 spec/integration/auditable_spec.rb
active-fedora-7.1.1 spec/integration/auditable_spec.rb
active-fedora-7.1.0 spec/integration/auditable_spec.rb
active-fedora-6.7.8 spec/integration/auditable_spec.rb
active-fedora-7.0.4 spec/integration/auditable_spec.rb
active-fedora-7.0.3 spec/integration/auditable_spec.rb
active-fedora-7.0.2 spec/integration/auditable_spec.rb
active-fedora-7.0.1 spec/integration/auditable_spec.rb
active-fedora-7.0.0 spec/integration/auditable_spec.rb