title: How to find out within a Capybara spec whether JS is active?
body: <p>Is there a way to detect within an Rspec example whether JavaScript is currently active?</p>
  <p>I have a helper function that needs to react differently depending on JavaScript available or not.</p>
  <pre><code>module Autocomplete
    def select_from_autocomplete(label, id, js = false)
      fill_in &quot;#{id}_filter&quot;, with: label # Open autocomplete and filter
      find('label', text: label, visible: js).click    # Capybara's click() doesn't work because the input is visually hidden! And we have to use visible = false because when JS is off, the elements wouldn't be found.
    end
  end
  
  RSpec.configure do |config|
    config.include Autocomplete, type: :feature
  end
  </code></pre>
  <p>Currently I pass the flag manually (<code>js = true</code>), but I would like to detect this automatically.</p>