spec/features/search_spec.rb
#
# To test onSubmit loading state change we need to prevent the form from actually
# submitting itself
#
To test onSubmit loading state change we need to prevent the form from actually
submitting itself
To test onSubmit loading state change we need to prevent the form from actually submitting itself
def search_for(query, container: ".navbar", halt: false, visit_home_first: true)
    visit "/" if visit_home_first
    page.evaluate_script halt_form_submission_js if halt
    within container do
      fill_in "q", with: query
      click_button "Search"
    end
  end
def search_for ( query , container : ".navbar" , halt : false , visit_home_first : true ) visit "/" if visit_home_first page . evaluate_script halt_form_submission_js if halt within container do fill_in "q" , with : query click_button "Search" end end
To test onSubmit loading state change we need to prevent the form from actually
submitting itself
To test onSubmit loading state change we need to prevent the form from actually submitting itself
query
container
halt
visit_home_first