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