Skip to content

Instantly share code, notes, and snippets.

@ohammersmith
Created April 29, 2009 22:38
Show Gist options
  • Select an option

  • Save ohammersmith/104117 to your computer and use it in GitHub Desktop.

Select an option

Save ohammersmith/104117 to your computer and use it in GitHub Desktop.
Snippets needed to make webrat work in rails integration tests.
./script/generate integration selenium_attach_file
require 'test_helper'
class SeleniumAttachFileTest < ActionController::IntegrationTest
fixtures :all
test "attach a file with webrat" do
visit "/"
# sleep 60
selenium.attach_file("id=some_file", "file:///Users/otto/repos/protopipe/Rakefile")
sleep 120
end
end
require 'webrat'
Webrat.configure do |config|
# config.mode = :rails
config.mode = :selenium
config.selenium_browser_key = "*firefox3"
# config.selenium_browser_key = "*safari"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment