Sha256: afe6f8030cc84fa6b51d9b9c3c8b773c9a5a12af93c2c7fcfd40340c117f4bb6

Contents?: true

Size: 749 Bytes

Versions: 32

Compression:

Stored size: 749 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::Base do
  describe ".uri_prefix" do
    let(:path) { "foo" }

    before do
      class FooHistory < ActiveFedora::Base
        def uri_prefix
          "foo"
        end
        property :title, predicate: ::RDF::Vocab::DC.title
      end
    end

    after do
      Object.send(:remove_const, :FooHistory)
    end

    subject { FooHistory.new(title: ["Root foo"]) }

    it { is_expected.to have_uri_prefix }

    it "uses the root path in the uri" do
      expect(subject.uri_prefix).to eql path
    end

    context "when the object is saved" do
      before { subject.save }

      it "persists the path in the uri" do
        expect(subject.uri.to_s).to include(path)
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
active-fedora-10.3.0 spec/unit/pathing_spec.rb
active-fedora-9.7.3 spec/unit/pathing_spec.rb
active-fedora-10.3.0.rc2 spec/unit/pathing_spec.rb
active-fedora-10.3.0.rc1 spec/unit/pathing_spec.rb
active-fedora-10.2.1 spec/unit/pathing_spec.rb
active-fedora-10.2.0 spec/unit/pathing_spec.rb
active-fedora-11.0.0.rc1 spec/unit/pathing_spec.rb
active-fedora-10.1.0 spec/unit/pathing_spec.rb
active-fedora-10.1.0.rc1 spec/unit/pathing_spec.rb
active-fedora-9.7.2 spec/unit/pathing_spec.rb
active-fedora-10.0.0 spec/unit/pathing_spec.rb
active-fedora-10.0.0.beta4 spec/unit/pathing_spec.rb
active-fedora-10.0.0.beta3 spec/unit/pathing_spec.rb
active-fedora-10.0.0.beta2 spec/unit/pathing_spec.rb
active-fedora-10.0.0.beta1 spec/unit/pathing_spec.rb
active-fedora-9.13.0 spec/unit/pathing_spec.rb
active-fedora-9.12.0 spec/unit/pathing_spec.rb
active-fedora-9.11.0 spec/unit/pathing_spec.rb
active-fedora-9.10.4 spec/unit/pathing_spec.rb
active-fedora-9.10.3 spec/unit/pathing_spec.rb