aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorGeorge Claghorn <george.claghorn@gmail.com>2018-12-30 16:17:16 -0500
committerGitHub <noreply@github.com>2018-12-30 16:17:16 -0500
commite7bcbf7b29107d93633746644b1e18e626366934 (patch)
treeb294a0954d107bf23beff40a42a4ec9e59b99e6e /railties
parentf28b28fe8d675cecd87f944a145024dfaaaaa983 (diff)
downloadrails-e7bcbf7b29107d93633746644b1e18e626366934.tar.gz
rails-e7bcbf7b29107d93633746644b1e18e626366934.tar.bz2
rails-e7bcbf7b29107d93633746644b1e18e626366934.zip
Add Rake task for testing mailboxes
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG.md4
-rw-r--r--railties/lib/rails/test_unit/testing.rake2
-rw-r--r--railties/test/application/test_runner_test.rb16
3 files changed, 19 insertions, 3 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index 8e358b4293..edfd5e2cd1 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -1,3 +1,7 @@
+* Add `rails test:mailboxes`.
+
+ *George Claghorn*
+
* Introduce guard against DNS rebinding attacks
The `ActionDispatch::HostAuthorization` is a new middleware that prevent
diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake
index 32ac27a135..ecc458b21e 100644
--- a/railties/lib/rails/test_unit/testing.rake
+++ b/railties/lib/rails/test_unit/testing.rake
@@ -28,7 +28,7 @@ namespace :test do
desc "Run tests quickly, but also reset db"
task db: %w[db:test:prepare test]
- ["models", "helpers", "controllers", "mailers", "integration", "jobs"].each do |name|
+ ["models", "helpers", "controllers", "mailers", "integration", "jobs", "mailboxes"].each do |name|
task name => "test:prepare" do
$: << "test"
Rails::TestUnit::Runner.rake_run(["test/#{name}"])
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb
index 55ce72181f..6765eef9d0 100644
--- a/railties/test/application/test_runner_test.rb
+++ b/railties/test/application/test_runner_test.rb
@@ -131,6 +131,18 @@ module ApplicationTests
end
end
+ def test_run_mailboxes
+ create_test_file :mailboxes, "foo_mailbox"
+ create_test_file :mailboxes, "bar_mailbox"
+ create_test_file :models, "foo"
+
+ rails("test:mailboxes").tap do |output|
+ assert_match "FooMailboxTest", output
+ assert_match "BarMailboxTest", output
+ assert_match "2 runs, 2 assertions, 0 failures", output
+ end
+ end
+
def test_run_functionals
create_test_file :mailers, "foo_mailer"
create_test_file :controllers, "bar_controller"
@@ -155,11 +167,11 @@ module ApplicationTests
end
def test_run_all_suites
- suites = [:models, :helpers, :unit, :controllers, :mailers, :functional, :integration, :jobs]
+ suites = [:models, :helpers, :unit, :controllers, :mailers, :functional, :integration, :jobs, :mailboxes]
suites.each { |suite| create_test_file suite, "foo_#{suite}" }
run_test_command("") .tap do |output|
suites.each { |suite| assert_match "Foo#{suite.to_s.camelize}Test", output }
- assert_match "8 runs, 8 assertions, 0 failures", output
+ assert_match "9 runs, 9 assertions, 0 failures", output
end
end