1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Tweaked wording used in some tests.

This commit is contained in:
Sebastian McKenzie 2015-10-25 08:57:50 +00:00
parent 6843cf6a94
commit a97dcde689
5 changed files with 16 additions and 16 deletions

View file

@ -93,13 +93,13 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest
assert_kind_of AbstractController::ActionNotFound, env["action_dispatch.exception"] assert_kind_of AbstractController::ActionNotFound, env["action_dispatch.exception"]
assert_equal "/404", env["PATH_INFO"] assert_equal "/404", env["PATH_INFO"]
assert_equal "/not_found_original_exception", env["action_dispatch.original_path"] assert_equal "/not_found_original_exception", env["action_dispatch.original_path"]
[404, { "Content-Type" => "text/plain" }, ["YOU FAILED BRO"]] [404, { "Content-Type" => "text/plain" }, ["YOU FAILED"]]
end end
@app = ActionDispatch::ShowExceptions.new(Boomer.new, exceptions_app) @app = ActionDispatch::ShowExceptions.new(Boomer.new, exceptions_app)
get "/not_found_original_exception", headers: { 'action_dispatch.show_exceptions' => true } get "/not_found_original_exception", headers: { 'action_dispatch.show_exceptions' => true }
assert_response 404 assert_response 404
assert_equal "YOU FAILED BRO", body assert_equal "YOU FAILED", body
end end
test "returns an empty response if custom exceptions app returns X-Cascade pass" do test "returns an empty response if custom exceptions app returns X-Cascade pass" do

View file

@ -1 +1 @@
Great story, bro! Great story!

View file

@ -83,10 +83,10 @@ class AutomaticInverseFindingTests < ActiveRecord::TestCase
assert_equal rating.comment, comment, "The Rating's comment should be the original Comment" assert_equal rating.comment, comment, "The Rating's comment should be the original Comment"
rating.comment.body = "Brogramming is the act of programming, like a bro." rating.comment.body = "Fennec foxes are the smallest of the foxes."
assert_equal rating.comment.body, comment.body, "Changing the Comment's body on the association should change the original Comment's body" assert_equal rating.comment.body, comment.body, "Changing the Comment's body on the association should change the original Comment's body"
comment.body = "Broseiden is the king of the sea of bros." comment.body = "Kittens are adorable."
assert_equal comment.body, rating.comment.body, "Changing the original Comment's body should change the Comment's body on the association" assert_equal comment.body, rating.comment.body, "Changing the original Comment's body should change the Comment's body on the association"
end end
@ -97,10 +97,10 @@ class AutomaticInverseFindingTests < ActiveRecord::TestCase
assert_equal rating.comment, comment, "The Rating's comment should be the original Comment" assert_equal rating.comment, comment, "The Rating's comment should be the original Comment"
rating.comment.body = "Brogramming is the act of programming, like a bro." rating.comment.body = "Fennec foxes are the smallest of the foxes."
assert_equal rating.comment.body, comment.body, "Changing the Comment's body on the association should change the original Comment's body" assert_equal rating.comment.body, comment.body, "Changing the Comment's body on the association should change the original Comment's body"
comment.body = "Broseiden is the king of the sea of bros." comment.body = "Kittens are adorable."
assert_equal comment.body, rating.comment.body, "Changing the original Comment's body should change the Comment's body on the association" assert_equal comment.body, rating.comment.body, "Changing the original Comment's body should change the Comment's body on the association"
end end

View file

@ -72,11 +72,11 @@ class TaggedLoggingTest < ActiveSupport::TestCase
test "keeps each tag in their own thread" do test "keeps each tag in their own thread" do
@logger.tagged("BCX") do @logger.tagged("BCX") do
Thread.new do Thread.new do
@logger.tagged("OMG") { @logger.info "Cool story bro" } @logger.tagged("OMG") { @logger.info "Cool story" }
end.join end.join
@logger.info "Funky time" @logger.info "Funky time"
end end
assert_equal "[OMG] Cool story bro\n[BCX] Funky time\n", @output.string assert_equal "[OMG] Cool story\n[BCX] Funky time\n", @output.string
end end
test "keeps each tag in their own instance" do test "keeps each tag in their own instance" do
@ -84,11 +84,11 @@ class TaggedLoggingTest < ActiveSupport::TestCase
@other_logger = ActiveSupport::TaggedLogging.new(MyLogger.new(@other_output)) @other_logger = ActiveSupport::TaggedLogging.new(MyLogger.new(@other_output))
@logger.tagged("OMG") do @logger.tagged("OMG") do
@other_logger.tagged("BCX") do @other_logger.tagged("BCX") do
@logger.info "Cool story bro" @logger.info "Cool story"
@other_logger.info "Funky time" @other_logger.info "Funky time"
end end
end end
assert_equal "[OMG] Cool story bro\n", @output.string assert_equal "[OMG] Cool story\n", @output.string
assert_equal "[BCX] Funky time\n", @other_output.string assert_equal "[BCX] Funky time\n", @other_output.string
end end
@ -97,11 +97,11 @@ class TaggedLoggingTest < ActiveSupport::TestCase
Thread.new do Thread.new do
@logger.tagged("OMG") do @logger.tagged("OMG") do
@logger.flush @logger.flush
@logger.info "Cool story bro" @logger.info "Cool story"
end end
end.join end.join
end end
assert_equal "[FLUSHED]\nCool story bro\n", @output.string assert_equal "[FLUSHED]\nCool story\n", @output.string
end end
test "mixed levels of tagging" do test "mixed levels of tagging" do

View file

@ -48,7 +48,7 @@ module ApplicationTests
test "uses custom exceptions app" do test "uses custom exceptions app" do
add_to_config <<-RUBY add_to_config <<-RUBY
config.exceptions_app = lambda do |env| config.exceptions_app = lambda do |env|
[404, { "Content-Type" => "text/plain" }, ["YOU FAILED BRO"]] [404, { "Content-Type" => "text/plain" }, ["YOU FAILED"]]
end end
RUBY RUBY
@ -56,7 +56,7 @@ module ApplicationTests
get "/foo" get "/foo"
assert_equal 404, last_response.status assert_equal 404, last_response.status
assert_equal "YOU FAILED BRO", last_response.body assert_equal "YOU FAILED", last_response.body
end end
test "url generation error when action_dispatch.show_exceptions is set raises an exception" do test "url generation error when action_dispatch.show_exceptions is set raises an exception" do