Sha256: 60011f431c48ffdaf66ded0e40ffd0c2606de1f51b9c20234fdb2c78f5017ac0

Contents?: true

Size: 1.03 KB

Versions: 9

Compression:

Stored size: 1.03 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].size.should == 1
      assigns[:file_assets].first["id"].should == "hydrangea:fixture_uploaded_svg1"
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hydra-head-4.0.3 test_support/spec/controllers/hydra_controller_spec.rb
hydra-head-4.0.2 test_support/spec/controllers/hydra_controller_spec.rb
hydra-head-4.0.1 test_support/spec/controllers/hydra_controller_spec.rb
hydra-head-4.0.0 test_support/spec/controllers/hydra_controller_spec.rb
hydra-head-4.0.0.rc6 test_support/spec/controllers/hydra_controller_spec.rb
hydra-head-4.0.0.rc5 test_support/spec/controllers/hydra_controller_spec.rb
hydra-head-4.0.0.rc4 test_support/spec/controllers/hydra_controller_spec.rb
hydra-head-4.0.0.rc3 test_support/spec/controllers/hydra_controller_spec.rb
hydra-head-4.0.0.rc2 test_support/spec/controllers/hydra_controller_spec.rb