Sha256: e422ebdfe0e99cbb8339a3a471fa93a977e85748a4c0353fb5021d080bc06555

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

class HydraControllerTest < ApplicationController
  include Hydra::Controller
end

describe HydraControllerTest do
  
  after :all do
    Object.send(:remove_const, :HydraControllerTest)
  end
  
  it "should add the necessary helpers to classes that include it" do
    HydraControllerTest.expects(:helper).with(:hydra)
    HydraControllerTest.expects(:helper).with(:hydra_assets)
    HydraControllerTest.stubs(:before_filter)
    HydraControllerTest.send(:include, Hydra::Controller)
  end
  
  describe "load_fedora_document" do

    it "should load @document_fedora and @file_assets" do
      controller.params[:id] = 'hydrangea:fixture_mods_article1'
      controller.load_fedora_document
      
      assigns[:document_fedora].class.should == ModsAsset 
      assigns[:document_fedora].pid.should == 'hydrangea:fixture_mods_article1' 
      assigns[:file_assets].class.should == Solr::Response::Standard
      assigns[:file_assets].hits.size.should == 1
      assigns[:file_assets].hits.first["id"].should == "hydrangea:fixture_uploaded_svg1"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hydra-head-3.3.0 test_support/spec/controllers/hydra_controller_spec.rb