Sha256: ef1f5da1995a9154527e0ab156841a52d35a735456b7537a7ef6de291fbb45cf

Contents?: true

Size: 978 Bytes

Versions: 28

Compression:

Stored size: 978 Bytes

Contents

require File.expand_path( File.join( File.dirname(__FILE__),'..','spec_helper') )


# See cucumber tests (ie. /features/edit_document.feature) for more tests, including ones that test the edit method & view
# You can run the cucumber tests with 
#
# cucumber --tags @edit
# or
# rake cucumber

describe Hydra::RepositoryController do
  
  describe "load_document_from_params" do
    it "should choose which model to use based on submitted params" do
      mock_model_class = mock("model class")
      mock_model_class.expects(:find).with("object id")
      helper.stubs(:params).returns( {:content_type => "preferred model", :id => "object id"} )
      helper.expects(:retrieve_af_model).with("preferred model").returns(mock_model_class)
      helper.load_document_from_params
    end
  end
  
  describe "format_pid" do
    it "convert pids into XHTML safe strings" do 
     pid = helper.format_pid("hydra:123")
     pid.should match(/hydra_123/)   
    end 
  end
  
  
  
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
hydra-head-3.3.0 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.2.2 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.2.1 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.2.0 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.2.0.pre3 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.2.0.pre2 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.2.0.pre1 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.1.5 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.1.4 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.1.3 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.1.2 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.1.1 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.1.0 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.1.0.rc2 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.1.0.rc1 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.1.0.pre5 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.1.0.pre4 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.1.0.pre3 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.0.1 test_support/spec/helpers/hydra-repository_controller_spec.rb
hydra-head-3.1.0.pre2 test_support/spec/helpers/hydra-repository_controller_spec.rb