Sha256: 815299119900dfd2819af8a1d305806fe0246f75372840479302fa8874d636b2

Contents?: true

Size: 870 Bytes

Versions: 40

Compression:

Stored size: 870 Bytes

Contents

require 'spec_helper'

RSpec.describe ActiveFedora::Core::FedoraIdTranslator do
  describe ".call" do
    let(:result) { described_class.call(id) }
    context "when given an id" do
      let(:good_uri) { ActiveFedora.fedora.host + ActiveFedora.fedora.base_path + "/banana" }
      let(:id) { "banana" }
      it "returns a fedora URI" do
        expect(result).to eq good_uri
      end

      context "with a leading slash" do
        let(:id) { "/banana" }
        it "returns a good fedora URI" do
          expect(result).to eq good_uri
        end
      end

      context "with characters that need escaping" do
        let(:good_uri) { ActiveFedora.fedora.host + ActiveFedora.fedora.base_path + "/%5Bfrob%5D" }
        let(:id) { "[frob]" }
        it "returns a good fedora URI" do
          expect(result).to eq good_uri
        end
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
active-fedora-9.7.3 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-11.0.1 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-11.0.0 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-10.3.0.rc2 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-11.0.0.rc7 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-10.3.0.rc1 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-11.0.0.rc6 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-10.2.1 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-11.0.0.rc5 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-11.0.0.rc4 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-10.2.0 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-11.0.0.rc3 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-11.0.0.rc2 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-11.0.0.rc1 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-10.1.0 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-10.1.0.rc1 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-9.7.2 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-10.0.0 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-10.0.0.beta4 spec/unit/core/fedora_id_translator_spec.rb
active-fedora-10.0.0.beta3 spec/unit/core/fedora_id_translator_spec.rb