From 3e7be525860473805a66db6ac6d030f99d52e6cb Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Fri, 11 Mar 2022 11:23:46 -0800 Subject: [PATCH] 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 ' # ------------------ # --- 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 ' Failed examples: rspec ./spec/features/surveys_spec.rb:15 # Survey as an organizer create a survey --- app/views/admin/survey_questions/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/survey_questions/_form.html.haml b/app/views/admin/survey_questions/_form.html.haml index a4e1eea6..0cde22c5 100644 --- a/app/views/admin/survey_questions/_form.html.haml +++ b/app/views/admin/survey_questions/_form.html.haml @@ -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]' }