]> source.dussan.org Git - redmine.git/commitdiff
scm: git: add functional test of diff with revision and path (#11752)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 31 Aug 2012 22:22:26 +0000 (22:22 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 31 Aug 2012 22:22:26 +0000 (22:22 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10245 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/repositories_git_controller_test.rb

index 333f379f318c8228bb32777f1cf2685e2dc76f72..abb3412ece4394ffaf1e99b5613ae8239ff7900d 100644 (file)
@@ -285,6 +285,30 @@ class RepositoriesGitControllerTest < ActionController::TestCase
       end
     end
 
+    def test_diff_with_rev_and_path
+      assert_equal 0, @repository.changesets.count
+      @repository.fetch_changesets
+      @project.reload
+      assert_equal NUM_REV, @repository.changesets.count
+      # Full diff of changeset 2f9c0091
+      ['inline', 'sbs'].each do |dt|
+        get :diff,
+            :id   => PRJ_ID,
+            :rev  => '2f9c0091c754a91af7a9c478e36556b4bde8dcf7',
+            :path => repository_path_hash(['sources', 'watchers_controller.rb'])[:param],
+            :type => dt
+        assert_response :success
+        assert_template 'diff'
+        # Line 22 removed
+        assert_tag :tag => 'th',
+                   :content => '22',
+                   :sibling => { :tag => 'td',
+                                 :attributes => { :class => /diff_out/ },
+                                 :content => /def remove/ }
+        assert_tag :tag => 'h2', :content => /2f9c0091/
+      end
+    end
+
     def test_diff_truncated
       assert_equal 0, @repository.changesets.count
       @repository.fetch_changesets