breaking up selenium from rails_webrat tests for the moment

This commit is contained in:
Mike Gaffney 2009-01-13 00:26:49 -06:00
parent c0220232c7
commit 758e323f89
2 changed files with 27 additions and 1 deletions

View File

@ -20,7 +20,7 @@ Rake::Task['test_unit_webrat'].comment = "runs the test::unit based tests in web
Rake::TestTask.new(:test_unit_selenium => "db:test:prepare") do |t|
ENV['WEBRAT_INTEGRATION_MODE'] = 'selenium'
t.libs << "test"
t.pattern = 'test/integration/**/*_test.rb'
t.pattern = 'test/selenium/**/*_test.rb'
t.verbose = true
end
Rake::Task['test_unit_selenium'].comment = "runs the test::unit based tests in selenium mode"

View File

@ -0,0 +1,26 @@
require 'test_helper'
class WebratTest < ActionController::IntegrationTest
test "should visit pages" do
visit root_path
assert_contain("Webrat Form")
end
test "should submit forms" do
visit root_path
fill_in "Text field", :with => "Hello"
check "TOS"
select "January"
click_button "Test"
end
test "should follow internal redirects" do
visit internal_redirect_path
assert response_body.include?("OK")
end
test "should not follow external redirects" do
visit external_redirect_path
assert response.redirect?
end
end