This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Removing unused code

  • Loading branch information...
vinibaggio committed Feb 28, 2011
1 parent 9ec7d8a commit 4f88d002dff37bb6869fb7247fe3afeaa9688089
Showing with 6 additions and 16 deletions.
  1. +6 −16 lib/hermes/actions.rb
View
@@ -1,15 +1,6 @@
module Hermes
# A few actions built on top of Capybara.
module Actions
%w(check uncheck).each do |method|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{method}(scope, prefix=nil)
scope = ActionController::RecordIdentifier.dom_id(scope, prefix) if scope.is_a?(ActiveRecord::Base)
super(scope)
end
RUBY
end
def select_datetime(datetime, options={})
no_select_msg = "cannot select option, no select box with id, name, or label '#{options[:from]}' found"
input = find(:xpath, XPath::HTML.select(options[:from]), :message => no_select_msg)
@@ -23,12 +14,11 @@ def select_datetime(datetime, options={})
end
private
def find_and_select_option(select_id, order, value)
no_select_msg = "cannot select option, no select box with id, name, or label '#{select_id}' found"
no_option_msg = "cannot select option, no option with text '#{value}' in select box '#{select_id}'"
select = find(:css, "##{select_id}_#{order}i", :message => no_select_msg)
select.find(:xpath, ".//option[contains(./@value, '#{value}')]", :message => no_option_msg).select_option
end
def find_and_select_option(select_id, order, value)
no_select_msg = "cannot select option, no select box with id, name, or label '#{select_id}' found"
no_option_msg = "cannot select option, no option with text '#{value}' in select box '#{select_id}'"
select = find(:css, "##{select_id}_#{order}i", :message => no_select_msg)
select.find(:xpath, ".//option[contains(./@value, '#{value}')]", :message => no_option_msg).select_option
end
end
end
end

0 comments on commit 4f88d00

Please sign in to comment.