Sha256: 4130cd89f5127efaf34b6aefbedcfc7143a7428f683517a9e456ae7a4109792a
Contents?: true
Size: 809 Bytes
Versions: 14
Compression:
Stored size: 809 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 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 pid = subject.format_pid("hydra:123") pid.should match(/hydra_123/) end end end
Version data entries
14 entries across 14 versions & 1 rubygems