aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_view/template_error.rb6
2 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index ec19b42a5e..8e5492dd0f 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fix TemplateError so it doesn't bomb on exceptions while running tests [rick]
+
* Fixed that named routes living under resources shouldn't have double slashes #10198 [isaacfeliu]
* Make sure that cookie sessions use a secret that is at least 30 chars in length. [Koz]
diff --git a/actionpack/lib/action_view/template_error.rb b/actionpack/lib/action_view/template_error.rb
index f82cb31846..01b4b15550 100644
--- a/actionpack/lib/action_view/template_error.rb
+++ b/actionpack/lib/action_view/template_error.rb
@@ -81,9 +81,9 @@ module ActionView
private
def strip_base_path(path)
- File.expand_path(path).
- gsub(/^#{Regexp.escape File.expand_path(RAILS_ROOT)}/, '').
- gsub(@base_path, "")
+ stripped_path = File.expand_path(path).gsub(@base_path, "")
+ stripped_path.gsub!(/^#{Regexp.escape File.expand_path(RAILS_ROOT)}/, '') if defined?(RAILS_ROOT)
+ stripped_path
end
def source_location