diff test/functional/repositories_bazaar_controller_test.rb @ 511:107d36338b70 live

Merge from branch "cannam"
author Chris Cannam
date Thu, 14 Jul 2011 10:43:07 +0100
parents cbce1fd3b1b7
children cbb26bc654de
line wrap: on
line diff
--- a/test/functional/repositories_bazaar_controller_test.rb	Thu Jun 09 16:51:06 2011 +0100
+++ b/test/functional/repositories_bazaar_controller_test.rb	Thu Jul 14 10:43:07 2011 +0100
@@ -15,7 +15,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
-require File.dirname(__FILE__) + '/../test_helper'
+require File.expand_path('../../test_helper', __FILE__)
 require 'repositories_controller'
 
 # Re-raise errors caught by the controller.
@@ -32,9 +32,13 @@
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
     User.current = nil
-    Repository::Bazaar.create(:project => Project.find(3), :url => REPOSITORY_PATH)
+    @project = Project.find(3)
+    @repository = Repository::Bazaar.create(
+                    :project => @project, :url => REPOSITORY_PATH,
+                    :log_encoding => 'UTF-8')
+    assert @repository
   end
-  
+
   if File.directory?(REPOSITORY_PATH)
     def test_show
       get :show, :id => 3
@@ -43,7 +47,7 @@
       assert_not_nil assigns(:entries)
       assert_not_nil assigns(:changesets)
     end
-    
+
     def test_browse_root
       get :show, :id => 3
       assert_response :success
@@ -53,7 +57,7 @@
       assert assigns(:entries).detect {|e| e.name == 'directory' && e.kind == 'dir'}
       assert assigns(:entries).detect {|e| e.name == 'doc-mkdir.txt' && e.kind == 'file'}
     end
-    
+
     def test_browse_directory
       get :show, :id => 3, :path => ['directory']
       assert_response :success
@@ -112,12 +116,12 @@
       get :diff, :id => 3, :rev => 3
       assert_response :success
       assert_template 'diff'
-      # Line 22 removed
+      # Line 11 removed
       assert_tag :tag => 'th',
-                 :content => /2/,
+                 :content => /11/,
                  :sibling => { :tag => 'td', 
-                               :attributes => { :class => /diff_in/ },
-                               :content => /Main purpose/ }
+                               :attributes => { :class => /diff_out/ },
+                               :content => /Display more information/ }
     end
     
     def test_annotate