module Capybara::Widgets::StringHelpers

Public Instance Methods

apply_action_chain(widget, chain) click to toggle source
# File lib/capybara/widgets/helpers/string_helpers.rb, line 12
def apply_action_chain(widget, chain)
  if chain.length > 0
    next_widget = widget.send(chain[0])
    return apply_action_chain(next_widget, chain[1..-1])
  else
    return widget
  end
end
to_widget_action(name, suffix=nil) click to toggle source
# File lib/capybara/widgets/helpers/string_helpers.rb, line 8
def to_widget_action(name, suffix=nil)
  "#{name.to_s.strip.downcase.gsub(' ','_')}#{suffix}"
end
to_widget_class(name) click to toggle source
# File lib/capybara/widgets/helpers/string_helpers.rb, line 4
def to_widget_class(name)
  name.to_s.strip.gsub(' ','_').classify.constantize
end