Sha256: 520b981437ed3010491fb4bc42a4fba519a932b11428cd574ad77acc6a83ae9b

Contents?: true

Size: 868 Bytes

Versions: 12

Compression:

Stored size: 868 Bytes

Contents

require 'spec_helper'

describe Hydra::Controller::RepositoryControllerBehavior do
  before(:all) do
    class RepositoryControllerTest < ApplicationController
      include Hydra::Controller::RepositoryControllerBehavior
    end
  end

  subject { RepositoryControllerTest.new }
  
  describe "load_document" do
    it "should load the model for the pid" do
      Deprecation.stub(:warn)
      mock_model = mock("model")
      subject.stub(:params).and_return( {:id => "object id"} )
      ActiveFedora::Base.should_receive(:find).with("object id", :cast=>true).and_return(mock_model)
      subject.send(:load_document).should == mock_model
    end
  end
  
  describe "format_pid" do
    it "convert pids into XHTML safe strings" do 
     Deprecation.stub(:warn)
     pid = subject.format_pid("hydra:123")
     pid.should match(/hydra_123/)   
    end 
  end
  
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hydra-core-5.4.1 spec/lib/repository_controller_behavior_spec.rb
hydra-core-5.4.0 spec/lib/repository_controller_behavior_spec.rb
hydra-core-6.0.0.pre3 spec/lib/repository_controller_behavior_spec.rb
hydra-core-6.0.0.pre2 spec/lib/repository_controller_behavior_spec.rb
hydra-core-6.0.0.pre1 spec/lib/repository_controller_behavior_spec.rb
hydra-core-5.4.0.pre1 spec/lib/repository_controller_behavior_spec.rb
hydra-core-5.3.0 spec/lib/repository_controller_behavior_spec.rb
hydra-core-5.2.0 spec/lib/repository_controller_behavior_spec.rb
hydra-core-5.1.0 spec/lib/repository_controller_behavior_spec.rb
hydra-core-5.0.1 spec/lib/repository_controller_behavior_spec.rb
hydra-core-5.0.0 spec/lib/repository_controller_behavior_spec.rb
hydra-core-5.0.0.rc1 spec/lib/repository_controller_behavior_spec.rb