Sha256: 24844b8e8b88411405d72c45c3804d77c5301c2d60b423940c2d9be428c72cc4

Contents?: true

Size: 720 Bytes

Versions: 76

Compression:

Stored size: 720 Bytes

Contents

require 'spec_helper'

describe 'MultifileInput', type: :input do
  class Foo
    extend ActiveModel::Naming
    include ActiveModel::Conversion
    include ActiveModel::Validations

    def persisted?
      false
    end

    attr_accessor :bar

    def [](val)
      raise "Unknown attribute" unless val == :bar
      bar
    end
  end

  let(:foo) { Foo.new }
  let(:bar) { ["bar1", "bar2"] }
  subject do
    foo.bar = bar
    input_for(foo, :files, as: :multifile)
  end

  it 'renders multifile' do
    expect(subject).to have_selector('.form-group.multifile label[for=foo_files]', text: 'Upload a file')
    expect(subject).to have_selector('.form-group.foo_files.multifile input[name="foo[files][]"]')
  end
end

Version data entries

76 entries across 76 versions & 3 rubygems

Version Path
hyrax-1.1.1 spec/inputs/multifile_input_spec.rb
hyrax-1.1.0 spec/inputs/multifile_input_spec.rb
hyrax-1.0.5 spec/inputs/multifile_input_spec.rb
curation_concerns-1.7.8 spec/inputs/multifile_input_spec.rb
hyrax-1.0.4 spec/inputs/multifile_input_spec.rb
hyrax-1.0.3 spec/inputs/multifile_input_spec.rb
hyrax-1.0.2 spec/inputs/multifile_input_spec.rb
hyrax-1.0.1 spec/inputs/multifile_input_spec.rb
hyrax-1.0.0.rc2 spec/inputs/multifile_input_spec.rb
curation_concerns-1.7.7 spec/inputs/multifile_input_spec.rb
curation_concerns-2.0.0 spec/inputs/multifile_input_spec.rb
curation_concerns-2.0.0.rc2 spec/inputs/multifile_input_spec.rb
hyrax-1.0.0.rc1 spec/inputs/multifile_input_spec.rb
curation_concerns-1.7.6 spec/inputs/multifile_input_spec.rb
curation_concerns-1.7.5 spec/inputs/multifile_input_spec.rb
test_hyrax-0.0.1.alpha spec/inputs/multifile_input_spec.rb
curation_concerns-1.7.4 spec/inputs/multifile_input_spec.rb
curation_concerns-1.7.3 spec/inputs/multifile_input_spec.rb
curation_concerns-1.7.2 spec/inputs/multifile_input_spec.rb
curation_concerns-2.0.0.rc1 spec/inputs/multifile_input_spec.rb