diff options
author | Michael Grosser <michael@grosser.it> | 2016-09-16 09:26:10 -0700 |
---|---|---|
committer | Michael Grosser <michael@grosser.it> | 2016-09-16 09:34:34 -0700 |
commit | fe98d21289b7510182e338f352f5a416bd01f1ad (patch) | |
tree | 79c48329ae9641b46e81de09966723cc9e23fa38 /railties/test | |
parent | f62451a50b2c9119adce7acc53ce3dfffc4d41d5 (diff) | |
download | rails-fe98d21289b7510182e338f352f5a416bd01f1ad.tar.gz rails-fe98d21289b7510182e338f352f5a416bd01f1ad.tar.bz2 rails-fe98d21289b7510182e338f352f5a416bd01f1ad.zip |
improve test coverage
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/test_test.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/railties/test/application/test_test.rb b/railties/test/application/test_test.rb index ef65c7a893..99d698114c 100644 --- a/railties/test/application/test_test.rb +++ b/railties/test/application/test_test.rb @@ -12,7 +12,7 @@ module ApplicationTests teardown_app end - test "truth" do + test "simple successful test" do app_file "test/unit/foo_test.rb", <<-RUBY require 'test_helper' @@ -26,6 +26,20 @@ module ApplicationTests assert_successful_test_run "unit/foo_test.rb" end + test "simple failed test" do + app_file "test/unit/foo_test.rb", <<-RUBY + require 'test_helper' + + class FooTest < ActiveSupport::TestCase + def test_truth + assert false + end + end + RUBY + + assert_unsuccessful_run "unit/foo_test.rb", "Failed assertion" + end + test "integration test" do controller "posts", <<-RUBY class PostsController < ActionController::Base @@ -289,7 +303,7 @@ Expected: ["id", "name"] def assert_unsuccessful_run(name, message) result = run_test_file(name) assert_not_equal 0, $?.to_i - assert result.include?(message) + assert_includes result, message result end |