Sha256: 3e76be2f3a1061175a45f02d8c300c455c5b258623b84693bfef0841571efc0c

Contents?: true

Size: 759 Bytes

Versions: 13

Compression:

Stored size: 759 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(:history) { FooHistory.new(title: ["Root 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

13 entries across 13 versions & 1 rubygems

Version Path
active-fedora-11.1.4 spec/unit/pathing_spec.rb
active-fedora-11.1.3 spec/unit/pathing_spec.rb
active-fedora-11.1.2 spec/unit/pathing_spec.rb
active-fedora-11.1.1 spec/unit/pathing_spec.rb
active-fedora-11.1.0 spec/unit/pathing_spec.rb
active-fedora-11.0.1 spec/unit/pathing_spec.rb
active-fedora-11.0.0 spec/unit/pathing_spec.rb
active-fedora-11.0.0.rc7 spec/unit/pathing_spec.rb
active-fedora-11.0.0.rc6 spec/unit/pathing_spec.rb
active-fedora-11.0.0.rc5 spec/unit/pathing_spec.rb
active-fedora-11.0.0.rc4 spec/unit/pathing_spec.rb
active-fedora-11.0.0.rc3 spec/unit/pathing_spec.rb
active-fedora-11.0.0.rc2 spec/unit/pathing_spec.rb