<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -36,11 +36,11 @@ class BuildsController &lt; ApplicationController
     @build = @project.find_build(params[:build])
     render :text =&gt; &quot;Build #{params[:build].inspect} not found&quot;, :status =&gt; 404 and return unless @build
 
-    path = File.join(@build.artifacts_directory, params[:path])
+    path = @build.artifact(params[:path])
 
     if File.directory? path
-      if File.exists?(path + '/index.html')
-        redirect_to :path =&gt; File.join(params[:path], 'index.html')
+      if File.exists?(File.join(path, 'index.html'))
+        redirect_to request.request_uri + '/index.html'
       else
         # TODO: generate an index from directory contents
         render :text =&gt; &quot;this should be an index of #{params[:path]}&quot;</diff>
      <filename>app/controllers/builds_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -139,8 +139,8 @@ EOF
         :controller =&gt; 'builds', :action =&gt; 'show', :project =&gt; project, :build =&gt; to_param)
   end
   
-  def artifact(file_name)
-    File.join(artifacts_directory, file_name)
+  def artifact(path)
+    File.join(artifacts_directory, path)
   end
 
   def contents_for_display(file)</diff>
      <filename>app/models/build.rb</filename>
    </modified>
    <modified>
      <diff>@@ -170,7 +170,7 @@ class BuildsControllerTest &lt; ActionController::TestCase
 
       get :artifact, :project =&gt; project.name, :build =&gt; '1', :path =&gt; 'foo'
 
-      assert_redirected_to :path =&gt; ['foo/index.html']
+      assert_redirected_to 'http://test.host/builds/my_project/1/foo/index.html'
     end
   end
 </diff>
      <filename>test/functional/builds_controller_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>52cb3161aadfd2e1e64458b4537631f048def8ef</id>
    </parent>
  </parents>
  <author>
    <name>Alex Verkhovsky</name>
    <email>alexey.verkhovsky@gmail.com</email>
  </author>
  <url>http://github.com/thoughtworks/cruisecontrol.rb/commit/c44b5959232810f9988b2d3cb9a8dcebd9dad5e5</url>
  <id>c44b5959232810f9988b2d3cb9a8dcebd9dad5e5</id>
  <committed-date>2009-09-29T17:35:36-07:00</committed-date>
  <authored-date>2009-09-29T17:35:36-07:00</authored-date>
  <message>Fixed an arttifact URL generation bug introduced by uprade to Rails 2.3</message>
  <tree>0a216c71fad729a1fc7f343ffab1a81b1fc8d03f</tree>
  <committer>
    <name>Alex Verkhovsky</name>
    <email>alexey.verkhovsky@gmail.com</email>
  </committer>
</commit>
