Associate form label with its control

Resolves:

    Failures:

      1) Survey as an organizer create a survey
         Failure/Error: select 'boolean', from: 'Type of Question:', visible: false # Hidden by bootstrap-select

         Capybara::ElementNotFound:
           Unable to find select box "Type of Question:" that is not disabled and Unable to find input box with datalist completion "Type of Question:" that is not disabled
         # ./spec/features/surveys_spec.rb:24:in `block (3 levels) in <top (required)>'
         # ------------------
         # --- Caused by: ---
         # Capybara::ElementNotFound:
         #   Unable to find select box "Type of Question:" that is not disabled
         #   ./spec/features/surveys_spec.rb:24:in `block (3 levels) in <top (required)>'

    Failed examples:

    rspec ./spec/features/surveys_spec.rb:15 # Survey as an organizer create a survey
This commit is contained in:
Andrew Kvalheim 2022-03-11 11:23:46 -08:00
parent d1a0167969
commit 3e7be52586

View file

@ -30,7 +30,7 @@
= f.label :max_choices
= f.number_field :max_choices, class: 'form-control'
.form-group
%label{ required: 'required' }
%label{ for: 'survey_question_kind', required: 'required' }
Type of Question:
.form-group
%select.selectpicker.form-control{ id: 'survey_question_kind', name: 'survey_question[kind]' }