Fallback to `select` if array of `checkboxes` fail

Allows fields that are arrays of strings to be passed to `<select multiple>`
inputs.
They might, but if we only check for the select, we just change the
selection for each array element then submit - no errors.

I'm a big fan of the Unix philosophy of failing early and loudly.

On Mon, Sep 15, 2014 at 02:26:37PM -0700, Sean Doyle wrote:
> > @@ -2,6 +2,26 @@ module Formulaic
> >    module Inputs
> >      class ArrayInput < Input
> >        def fill
> > +        if has_select?
> > +          select_options
> > +        else
> > +          check_boxes
> > +        end
> > +      rescue Capybara::ElementNotFound
> > +        raise InputNotFound.new(%[Unable to find input "#{label}".])
> > +      end
> > +
> > +      private
> > +
> > +      def has_select?
> > +        page.has_select?(label)
>
> Looking at the [docs](http://www.ruby-doc.org/gems/docs/c/capybara-rails-2-2-0.4.1.1/Capybara/Node/Matchers.html#method-i-has_select-3F), it doesn't look like we can filter for multiple selects.
>
> Would we really need to check for this? Wouldn't a `select`'s single/multiple selection come out when trying to fill it in and assert on the side effects of submitting the form?
>
> Wouldn't the onus be on the caller to pass in the correct label?
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/thoughtbot/formulaic/pull/34/files#r17569921