diff --git a/guides/source/testing.md b/guides/source/testing.md index 1187b6c183..0ebf8ca6c4 100644 --- a/guides/source/testing.md +++ b/guides/source/testing.md @@ -857,6 +857,7 @@ bin/rails test:system NOTE: By default, running `bin/rails test` won't run your system tests. Make sure to run `bin/rails test:system` to actually run them. +You can also run `bin/rails test:all` to run all tests, including system tests. #### Creating Articles System Test diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 2d626a0528..9245c3c84e 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,3 +1,9 @@ +* Adds `rails test:all` for running all tests in the test directory. + + This runs all test files in the test directory, including system tests. + + *Niklas Häusele* + * Add `config.generators.after_generate` for processing to generated files. Register a callback that will get called right after generators has finished. diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index 3a1b62d9d1..c8f118ea55 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -35,6 +35,12 @@ namespace :test do end end + desc "Runs all tests, including system tests" + task all: "test:prepare" do + $: << "test" + Rails::TestUnit::Runner.rake_run(["test/**/*_test.rb"]) + end + task generators: "test:prepare" do $: << "test" Rails::TestUnit::Runner.rake_run(["test/lib/generators"])