class Capybara::RackTest::Node

def click_label

def click_label
  labelled_control = if native[:for]
    find_xpath("//input[@id='#{native[:for]}']")
  else
    find_xpath(".//input")
  end.first
  if labelled_control && (labelled_control.checkbox? || labelled_control.radio?)
    labelled_control.set(!labelled_control.checked?)
  end
end