From e9c15d6b782b090e1cec6747d80e8df3aeb9efe6 Mon Sep 17 00:00:00 2001 From: Hongli Lai (Phusion) Date: Tue, 26 Aug 2008 15:59:03 +0200 Subject: [PATCH] The 'rails' command was broken by the last commit. Fix that. --- .gitignore | 1 + railties/html/500.html | 5 +++-- railties/test/error_page_test.rb | 8 +++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index bba7d5d..a86055e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ actionpack/pkg actionmailer/pkg activesupport/pkg railties/pkg +railties/test/500.html *.rbc diff --git a/railties/html/500.html b/railties/html/500.html index 328fdcc..74142cb 100644 --- a/railties/html/500.html +++ b/railties/html/500.html @@ -26,7 +26,8 @@

We're sorry, but something went wrong.

We've been notified about this issue and we'll take a look at it shortly.

(If you're the administrator of this website, then please read - the log file "<%=h RAILS_ENV %>.log" to find out what went wrong.)

+ the log file "<%= "<%s>" % "%=h RAILS_ENV %" %>.log" + to find out what went wrong.)

- \ No newline at end of file + diff --git a/railties/test/error_page_test.rb b/railties/test/error_page_test.rb index 0e43700..844f889 100644 --- a/railties/test/error_page_test.rb +++ b/railties/test/error_page_test.rb @@ -3,10 +3,12 @@ require 'action_controller' require 'action_controller/test_process' RAILS_ENV = "test" +CURRENT_DIR = File.expand_path(File.dirname(__FILE__)) +HTML_DIR = File.expand_path(File.join(CURRENT_DIR, "..", "html")) module Rails def self.public_path - File.expand_path(File.join(File.dirname(__FILE__), "..", "html")) + CURRENT_DIR end end @@ -30,6 +32,10 @@ class ErrorPageControllerTest < Test::Unit::TestCase end def test_500_error_page_instructs_system_administrator_to_check_log_file + template = ERB.new(File.read(File.join(HTML_DIR, "500.html"))) + File.open(File.join(CURRENT_DIR, "500.html"), "w") do |f| + f.write(template.result) + end get :crash expected_log_file = "#{RAILS_ENV}.log" assert_not_nil @response.body.index(expected_log_file) -- 1.5.6.3