Skip to content

Commit

Permalink
Support Merb 1.0 webrat integration.
Browse files Browse the repository at this point in the history
  • Loading branch information
david committed Nov 8, 2008
1 parent 7277d39 commit 4e52bb2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
Expand Up @@ -2,37 +2,37 @@
# http://github.com/brynary/webrat # http://github.com/brynary/webrat


When /^I go to (.*)$/ do |path| When /^I go to (.*)$/ do |path|
visits path visit path
end end


When /^I press "(.*)"$/ do |button| When /^I press "(.*)"$/ do |button|
clicks_button(button) click_button(button)
end end


When /^I follow "(.*)"$/ do |link| When /^I follow "(.*)"$/ do |link|
clicks_link(link) click_link(link)
end end


When /^I fill in "(.*)" with "(.*)"$/ do |field, value| When /^I fill in "(.*)" with "(.*)"$/ do |field, value|
fills_in(field, :with => value) fill_in(field, :with => value)
end end


When /^I select "(.*)" from "(.*)"$/ do |value, field| When /^I select "(.*)" from "(.*)"$/ do |value, field|
selects(value, :from => field) select(value, :from => field)
end end


When /^I check "(.*)"$/ do |field| When /^I check "(.*)"$/ do |field|
checks(field) check(field)
end end


When /^I uncheck "(.*)"$/ do |field| When /^I uncheck "(.*)"$/ do |field|
unchecks(field) uncheck(field)
end end


When /^I choose "(.*)"$/ do |field| When /^I choose "(.*)"$/ do |field|
chooses(field) choose(field)
end end


When /^I attach the file at "(.*)" to "(.*)" $/ do |path, field| When /^I attach the file at "(.*)" to "(.*)" $/ do |path, field|
attaches_file(field, path) attach_file(field, path)
end end
8 changes: 4 additions & 4 deletions lib/merb_cucumber/world/base.rb
Expand Up @@ -2,10 +2,10 @@ module Merb
module Test module Test
module World module World
module Base module Base
include Merb::Test::Matchers include ::Merb::Test::Matchers
include Merb::Test::ControllerHelper include ::Merb::Test::ControllerHelper
include Merb::Test::RouteHelper include ::Merb::Test::RouteHelper
include Merb::Test::ViewHelper include ::Merb::Test::ViewHelper
end end
end end
end end
Expand Down
5 changes: 3 additions & 2 deletions lib/merb_cucumber/world/webrat.rb
@@ -1,12 +1,13 @@
require File.join(File.dirname(__FILE__), 'base')
require 'webrat' require 'webrat'
require 'webrat/merb' require 'webrat/merb'
require File.join(File.dirname(__FILE__), 'base')


module Merb module Merb
module Test module Test
module World module World
class Webrat < ::Webrat::Session class Webrat
include Base include Base
include ::Webrat::Methods
end end
end end
end end
Expand Down

0 comments on commit 4e52bb2

Please sign in to comment.