Sha256: ccc7a5088d0ec3d9429f2daa36db1b18ec995d9d21635e8017779c6b271ef7d0

Contents?: true

Size: 758 Bytes

Versions: 28

Compression:

Stored size: 758 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::Base do
  describe ".uri_prefix" do
    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(:history) { FooHistory.new(title: ["Root foo"]) }
    let(:path) { "foo" }

    it { is_expected.to have_uri_prefix }

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

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

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

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
active-fedora-12.2.4 spec/unit/pathing_spec.rb
active-fedora-12.2.3 spec/unit/pathing_spec.rb
active-fedora-11.5.6 spec/unit/pathing_spec.rb
active-fedora-12.2.2 spec/unit/pathing_spec.rb
active-fedora-11.2.1 spec/unit/pathing_spec.rb
active-fedora-12.2.1 spec/unit/pathing_spec.rb
active-fedora-12.0.3 spec/unit/pathing_spec.rb
active-fedora-11.5.5 spec/unit/pathing_spec.rb
active-fedora-13.1.2 spec/unit/pathing_spec.rb
active-fedora-13.1.1 spec/unit/pathing_spec.rb
active-fedora-13.1.0 spec/unit/pathing_spec.rb
active-fedora-13.0.0 spec/unit/pathing_spec.rb
active-fedora-12.1.1 spec/unit/pathing_spec.rb
active-fedora-12.1.0 spec/unit/pathing_spec.rb
active-fedora-11.5.4 spec/unit/pathing_spec.rb
active-fedora-11.5.3 spec/unit/pathing_spec.rb
active-fedora-12.0.2 spec/unit/pathing_spec.rb
active-fedora-12.0.1 spec/unit/pathing_spec.rb
active-fedora-11.5.2 spec/unit/pathing_spec.rb
active-fedora-12.0.0 spec/unit/pathing_spec.rb