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

Adding some helper actions for checking and unchecking items.

  • Loading branch information...
Fabio Yamate
Fabio Yamate committed Oct 31, 2010
1 parent 5a8ed60 commit 18626394411f95a006ca34148b90d37bec28edbb
Showing with 14 additions and 0 deletions.
  1. +13 −0 lib/hermes/actions.rb
  2. +1 −0 lib/hermes/integration_case.rb
View
@@ -0,0 +1,13 @@
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
end
end
@@ -5,6 +5,7 @@ class Hermes::IntegrationCase < ActiveSupport::TestCase
include ActionController::RecordIdentifier
include Rails.application.routes.url_helpers
include Hermes::Assertions
include Hermes::Actions
teardown { Capybara.reset_sessions! }
class << self; alias :scenario :test; end

0 comments on commit 1862639

Please sign in to comment.