Sha256: 373580353a08e06986451620b91d0b6d416721e9cef516b1eabb2e889194f8a5

Contents?: true

Size: 1012 Bytes

Versions: 4

Compression:

Stored size: 1012 Bytes

Contents

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

describe HydraUploaderHelper do
  before :all do
    @behavior = Hydra::HydraUploaderHelperBehavior.deprecation_behavior
    Hydra::HydraUploaderHelperBehavior.deprecation_behavior = :silence
  end

  after :all do
    Hydra::HydraUploaderHelperBehavior.deprecation_behavior = @behavior
  end
  
  describe "upload_url" do
    it "should use container_id if its available" do
      helper.stubs(:params).returns(:asset_id=>"foo:22")
      helper.upload_url.should == "/hydra/assets/foo:22/file_assets"
    end
    it "should assume params[\"id\"] is pid of container when container_id is not set" do
      helper.stubs(:params).returns(:controller=>"catalog", :action=>"show", :id=>"foo:25")
      helper.upload_url.should == "/hydra/assets/foo:25/file_assets"
      helper.stubs(:params).returns(:controller=>"assets", :action=>"show", :id=>"foo:25")
      helper.upload_url.should == "/hydra/assets/foo:25/file_assets"
    end
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hydra-head-4.1.3 test_support/spec/helpers/hydra_uploader_helper_spec.rb
hydra-head-4.1.2 test_support/spec/helpers/hydra_uploader_helper_spec.rb
hydra-head-4.1.1 test_support/spec/helpers/hydra_uploader_helper_spec.rb
hydra-head-4.1.0 test_support/spec/helpers/hydra_uploader_helper_spec.rb