<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -613,8 +613,8 @@ module ActionController #:nodoc:
       #
       # This takes the current URL as is and only exchanges the action. In contrast, &lt;tt&gt;url_for :action =&gt; 'print'&lt;/tt&gt;
       # would have slashed-off the path components after the changed action.
-      def url_for(options = nil) #:doc:
-        case options || {}
+      def url_for(options = {}) #:doc:
+        case options
           when String
             options
           when Hash</diff>
      <filename>actionpack/lib/action_controller/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -169,6 +169,22 @@ class DefaultUrlOptionsTest &lt; Test::Unit::TestCase
   end
 end
 
+class EmptyUrlOptionsTest &lt; Test::Unit::TestCase
+  def setup
+    @controller = NonEmptyController.new
+
+    @request    = ActionController::TestRequest.new
+    @response   = ActionController::TestResponse.new
+
+    @request.host = 'www.example.com'
+  end
+
+  def test_ensure_url_for_works_as_expected_when_called_with_no_options_if_default_url_options_is_not_set
+    get :public_action
+    assert_equal &quot;http://www.example.com/non_empty/public_action&quot;, @controller.url_for
+  end
+end
+
 class EnsureNamedRoutesWorksTicket22BugTest &lt; Test::Unit::TestCase
   def test_named_routes_still_work
     ActionController::Routing::Routes.draw do |map|
@@ -180,4 +196,4 @@ class EnsureNamedRoutesWorksTicket22BugTest &lt; Test::Unit::TestCase
   ensure
     ActionController::Routing::Routes.load!
   end
-end
\ No newline at end of file
+end</diff>
      <filename>actionpack/test/controller/base_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5c071a78bea7f1a1bdee4e75a730dfca25ee938c</id>
    </parent>
  </parents>
  <author>
    <name>Luke Redpath</name>
    <email>contact@lukeredpath.co.uk</email>
  </author>
  <url>http://github.com/rails/rails/commit/a83ac48501aaba12b3d8abc0c6d6fdf0155de74d</url>
  <id>a83ac48501aaba12b3d8abc0c6d6fdf0155de74d</id>
  <committed-date>2008-06-17T13:00:28-07:00</committed-date>
  <authored-date>2008-06-05T05:20:54-07:00</authored-date>
  <message>Fix url_for with no arguments when default_url_options is not explicitly defined. [#339 state:resolved]

Signed-off-by: Pratik Naik &lt;pratiknaik@gmail.com&gt;</message>
  <tree>4482edf993ac1d6c0e43dd79d2748563ae8c1ddd</tree>
  <committer>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </committer>
</commit>
