Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created June 20, 2012 06:51
Show Gist options
  • Save jugyo/2958495 to your computer and use it in GitHub Desktop.
Save jugyo/2958495 to your computer and use it in GitHub Desktop.
capybara helper
# Usage
# -----
#
# spec_helper.rb
#
# RSpec.configure do |config|
# ...
# config.include CapybaraHelper, :type => :request
# ...
# end
#
# xxx_spec.rb
#
# it 'xxxxx' do
# ...
# fill 'Name' => 'foo',
# 'EMail' => 'foo@bar.com'
# click 'Update'
# ...
# end
#
module CapybaraHelper
def fill(hash)
hash.each do |k, v|
fill_in k, with: v
end
end
def click(*args)
click_on(*args)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment