Sha256: ae66e535fa3e629340146c4761dcff6d581566863b9c3d0ae2b40f956ad24cbc

Contents?: true

Size: 1.2 KB

Versions: 20

Compression:

Stored size: 1.2 KB

Contents

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

describe 'fluid_infusion/_uploader.html.erb' do
  before do
    view.stubs(:upload_url).returns("/assets/_PID_/file_assets")
    view.stubs(:container_id).returns('111')
  end

  it "should permit locals for container_content_type" do
    render :partial => "fluid_infusion/uploader", :locals => {:container_content_type=>"foo_bar"}
    rendered.should have_selector "form.fl-uploader.fl-progEnhance-basic", :action => "/assets/_PID_/file_assets" do
      with_tag "input#container_content_type", :value => "foo_bar"
    end
  end
  
  it "should permit locals for uploader html_options" do
    render :partial => "fluid_infusion/uploader", :locals => {:html_options=>{:uploader_options => {:accept => "application/pdf"}}}
    rendered.should have_selector "input#Filedata", :type => "file", :accept=>"application/pdf"
  end

  it "should work with no locals passed in" do
    render
    rendered.should have_selector  "form.fl-uploader.fl-progEnhance-basic", :action => "/assets/_PID_/file_assets" do
      without_tag "input#container_content_type"
      with_tag "input#Filedata", :type=>"file" do
        without_tag "[accept=?]"
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
hydra-head-3.1.4 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.1.3 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.1.2 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.1.1 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.1.0 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.1.0.rc2 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.1.0.rc1 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.1.0.pre5 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.1.0.pre4 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.1.0.pre3 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.0.1 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.1.0.pre2 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.0.0 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.1.0.pre1 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.0.0.rc2 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.0.0.rc1 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.0.0pre4 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.0.0pre3 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.0.0pre2 test_support/spec/views/uploader.html.erb_spec.rb
hydra-head-3.0.0pre1 test_support/spec/views/uploader.html.erb_spec.rb