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

The 'rails' command was broken by the last commit. Fix that.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
This commit is contained in:
Hongli Lai (Phusion 2008-08-26 15:59:03 +02:00 committed by Michael Koziarski
parent f9f1ab4e3d
commit c111522d5b
3 changed files with 11 additions and 3 deletions

1
.gitignore vendored
View file

@ -12,4 +12,5 @@ actionpack/pkg
actionmailer/pkg
activesupport/pkg
railties/pkg
railties/test/500.html
*.rbc

View file

@ -26,7 +26,8 @@
<h1>We're sorry, but something went wrong.</h1>
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
<p><small>(If you're the administrator of this website, then please read
the log file "<%=h RAILS_ENV %>.log" to find out what went wrong.)</small></p>
the log file "<%= "<%s>" % "%=h RAILS_ENV %" %>.log"
to find out what went wrong.)</small></p>
</div>
</body>
</html>
</html>

View file

@ -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)