diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
index 96976ce..c678f87 100644
--- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -11,7 +11,7 @@ module ActionView
# the assets exist before linking to them:
#
# image_tag("rails.png")
- # # =>
+ # # =>
# stylesheet_link_tag("application")
# # =>
#
@@ -530,7 +530,7 @@ module ActionView
options.symbolize_keys!
src = options[:src] = path_to_image(source)
- options[:alt] ||= File.basename(src, '.*').split('.').first.to_s.capitalize
+ options[:alt] ||= File.basename(src, '.*').capitalize
if size = options.delete(:size)
options[:width], options[:height] = size.split("x") if size =~ %r{^\d+x\d+$}
diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb
index 586de66..8ca0990 100644
--- a/actionpack/test/template/asset_tag_helper_test.rb
+++ b/actionpack/test/template/asset_tag_helper_test.rb
@@ -141,13 +141,16 @@ class AssetTagHelperTest < ActionView::TestCase
ImageLinkToTag = {
%(image_tag("xml.png")) => %(),
- %(image_tag("..jpg")) => %(),
+ %(image_tag("..jpg")) => %(),
%(image_tag("rss.gif", :alt => "rss syndication")) => %(),
%(image_tag("gold.png", :size => "45x70")) => %(),
%(image_tag("gold.png", "size" => "45x70")) => %(),
%(image_tag("error.png", "size" => "45")) => %(),
%(image_tag("error.png", "size" => "45 x 70")) => %(),
%(image_tag("error.png", "size" => "x")) => %(),
+ %(image_tag("google.com.png")) => %(),
+ %(image_tag("slash..png")) => %(),
+ %(image_tag(".pdf.png")) => %(),
%(image_tag("http://www.rubyonrails.com/images/rails.png")) => %(),
%(image_tag("mouse.png", :mouseover => "/images/mouse_over.png")) => %(),
%(image_tag("mouse.png", :mouseover => image_path("mouse_over.png"))) => %()