Sha256: c10fd30feefdb5e0d0f4a8d0beceebd43372d69aee8fa8f523a4daa97f7841a4

Contents?: true

Size: 895 Bytes

Versions: 41

Compression:

Stored size: 895 Bytes

Contents

require 'spec_helper'

describe "Checking fixity" do
  before(:all) do
    class MockAFBase < ActiveFedora::Base
      has_subresource "data", autocreate: true
    end
  end

  after(:all) do
    Object.send(:remove_const, :MockAFBase)
  end

  subject do
    obj = MockAFBase.create
    obj.data.content = "some content"
    obj.save
    obj.data.check_fixity
  end

  context "with a valid resource" do
    it { is_expected.to be true }
  end
  context "when no uri has been set" do
    subject(:file) { ActiveFedora::File.new }
    it "raises an error" do
      expect { file.check_fixity }.to raise_error(ArgumentError, "You must provide a uri")
    end
  end
  context "with missing resource" do
    subject(:file) { ActiveFedora::File.new(ActiveFedora::Base.id_to_uri('123')) }
    it "raises an error" do
      expect { file.check_fixity }.to raise_error(Ldp::NotFound)
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
active-fedora-11.5.0 spec/integration/file_fixity_spec.rb
active-fedora-11.4.1 spec/integration/file_fixity_spec.rb
active-fedora-11.4.0 spec/integration/file_fixity_spec.rb
active-fedora-11.3.1 spec/integration/file_fixity_spec.rb
active-fedora-11.3.0 spec/integration/file_fixity_spec.rb
active-fedora-11.2.0 spec/integration/file_fixity_spec.rb
active-fedora-11.1.6 spec/integration/file_fixity_spec.rb
active-fedora-11.1.5 spec/integration/file_fixity_spec.rb
active-fedora-11.1.4 spec/integration/file_fixity_spec.rb
active-fedora-11.1.3 spec/integration/file_fixity_spec.rb
active-fedora-11.1.2 spec/integration/file_fixity_spec.rb
active-fedora-11.1.1 spec/integration/file_fixity_spec.rb
active-fedora-11.1.0 spec/integration/file_fixity_spec.rb
active-fedora-11.0.1 spec/integration/file_fixity_spec.rb
active-fedora-11.0.0 spec/integration/file_fixity_spec.rb
active-fedora-11.0.0.rc7 spec/integration/file_fixity_spec.rb
active-fedora-11.0.0.rc6 spec/integration/file_fixity_spec.rb
active-fedora-11.0.0.rc5 spec/integration/file_fixity_spec.rb
active-fedora-11.0.0.rc4 spec/integration/file_fixity_spec.rb
active-fedora-11.0.0.rc3 spec/integration/file_fixity_spec.rb