Permalink
Browse files

Rendering default template for missing actions works with non-word ch…

…aracters in action name
  • Loading branch information...
jeremy committed Jul 7, 2008
1 parent 350faf1 commit 4354aa36fb0b94f3750256441054d42db9900bf5
@@ -74,7 +74,7 @@ def trim_forward_slash!(path)
# Returns file split into an array
# [base_path, name, format, extension]
def split(file)
- if m = file.match(/^(.*\/)?(\w+)\.?(\w+)?\.?(\w+)?\.?(\w+)?$/)
+ if m = file.match(/^(.*\/)?([^\.]+)\.?(\w+)?\.?(\w+)?\.?(\w+)?$/)
if m[5] # Mulipart formats
[m[1], m[2], "#{m[3]}.#{m[4]}", m[5]]
elsif m[4] # Single format
@@ -489,6 +489,11 @@ def test_simple_show
assert_equal "<html>Hello world!</html>", @response.body
end
+ def test_renders_default_template_for_missing_action
+ get :'hyphen-ated'
+ assert_template 'test/hyphen-ated'
+ end
+
def test_do_with_render
get :render_hello_world
assert_template "test/hello_world"
@@ -0,0 +1 @@
+Hello world!

0 comments on commit 4354aa3

Please sign in to comment.