Sha256: da787e736932dd7d7a1852c40c1367e43640c188a363c2a96df7f40a9d08bcf8

Contents?: true

Size: 751 Bytes

Versions: 9

Compression:

Stored size: 751 Bytes

Contents

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

describe HydraUploaderHelper do
  
  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

9 entries across 9 versions & 1 rubygems

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