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
curation_concerns-1.7.1 spec/inputs/multifile_input_spec.rb
curation_concerns-1.7.0 spec/inputs/multifile_input_spec.rb
curation_concerns-1.7.0.beta1 spec/inputs/multifile_input_spec.rb
curation_concerns-1.6.3 spec/inputs/multifile_input_spec.rb
curation_concerns-1.6.2 spec/inputs/multifile_input_spec.rb
curation_concerns-1.6.1 spec/inputs/multifile_input_spec.rb
curation_concerns-1.6.0 spec/inputs/multifile_input_spec.rb
curation_concerns-1.5.0 spec/inputs/multifile_input_spec.rb
curation_concerns-1.4.0 spec/inputs/multifile_input_spec.rb
curation_concerns-1.3.3 spec/inputs/multifile_input_spec.rb
curation_concerns-1.3.2 spec/inputs/multifile_input_spec.rb
curation_concerns-1.3.1 spec/inputs/multifile_input_spec.rb
curation_concerns-1.3.0 spec/inputs/multifile_input_spec.rb
curation_concerns-1.2.0 spec/inputs/multifile_input_spec.rb
curation_concerns-1.1.2 spec/inputs/multifile_input_spec.rb
curation_concerns-1.1.1 spec/inputs/multifile_input_spec.rb
curation_concerns-1.1.0 spec/inputs/multifile_input_spec.rb
curation_concerns-1.0.0 spec/inputs/multifile_input_spec.rb
curation_concerns-1.0.0.beta10 spec/inputs/multifile_input_spec.rb
curation_concerns-1.0.0.beta9 spec/inputs/multifile_input_spec.rb