diff --git a/spec/integration/rails/Rakefile b/spec/integration/rails/Rakefile index edb0445..e09ebc6 100644 --- a/spec/integration/rails/Rakefile +++ b/spec/integration/rails/Rakefile @@ -16,27 +16,15 @@ namespace :test_unit do desc "runs the test::unit based tests in webrat mode" task :rails do ENV['WEBRAT_INTEGRATION_MODE'] = 'rails' - Rake::Task['test_unit:rails_test'].execute + Rake::Task['test:integration'].execute end - - Rake::TestTask.new(:rails_test => "db:test:prepare") do |t| - t.libs << "test" - t.pattern = 'test/integration/**/*_test.rb' - t.verbose = true - end - + desc "runs the test::unit based tests in selenium mode" task :selenium do ENV['WEBRAT_INTEGRATION_MODE'] = 'selenium' - Rake::Task['test_unit:selenium_test'].execute + Rake::Task['test:integration'].execute end - - Rake::TestTask.new(:selenium_test => "db:test:prepare") do |t| - t.libs << "test" - t.pattern = 'test/selenium/**/*_test.rb' - t.verbose = true - end - - desc "run both selenium and rails mode Test::Unit suites" + + desc "run both selenium and rails mode Test::Unit suites" task :all => [:rails, :selenium] end diff --git a/spec/integration/rails/test/integration/webrat_rails_test.rb b/spec/integration/rails/test/integration/webrat_rails_test.rb deleted file mode 100644 index 07ba52f..0000000 --- a/spec/integration/rails/test/integration/webrat_rails_test.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'test_helper' - -class WebratTest < ActionController::IntegrationTest - - test "should scope within an object" do - visit root_path - - within FakeModel.new do - fill_in "Object field", :with => "Test" - - assert_raise Webrat::NotFoundError do - check "TOS" - end - end - end - -end diff --git a/spec/integration/rails/test/selenium/webrat_test.rb b/spec/integration/rails/test/selenium/webrat_test.rb deleted file mode 100644 index 16d027d..0000000 --- a/spec/integration/rails/test/selenium/webrat_test.rb +++ /dev/null @@ -1,48 +0,0 @@ -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 - - test "should click link by text" do - visit internal_redirect_path - click_link "Test Link Text" - assert_contain("Webrat Form") - end - - test "should click link by id" do - visit internal_redirect_path - click_link "link_id" - assert_contain("Webrat Form") - end - - test "should be able to assert xpath" do - visit root_path - assert_have_xpath "//h1" - end - - test "should be able to assert selector" do - visit root_path - assert_have_selector "h1" - end -end