]> source.dussan.org Git - redmine.git/commitdiff
add functional test of sub repository diff path (#11966)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 28 Sep 2012 03:43:51 +0000 (03:43 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 28 Sep 2012 03:43:51 +0000 (03:43 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10503 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/repositories_git_controller_test.rb

index edbb73a5ec1fcbe634e6b39d26413382d8c67159..e7337b2e67d889f88decac6c23e9a0f39fefe284 100644 (file)
@@ -368,6 +368,40 @@ class RepositoriesGitControllerTest < ActionController::TestCase
       end
     end
 
+    def test_diff_path_in_subrepo
+      repo = Repository::Git.create(
+                      :project       => @project,
+                      :url           => REPOSITORY_PATH,
+                      :identifier => 'test-diff-path',
+                      :path_encoding => 'ISO-8859-1'
+                      );
+      assert repo
+      assert_equal false, repo.is_default
+      assert_equal 'test-diff-path', repo.identifier
+      get :diff,
+          :id     => PRJ_ID,
+          :repository_id => 'test-diff-path',
+          :rev    => '61b685fbe55ab05b',
+          :rev_to => '2f9c0091c754a91a',
+          :type   => 'inline'
+      assert_response :success
+      assert_template 'diff'
+      diff = assigns(:diff)
+      assert_not_nil diff
+      assert_tag :tag => "form",
+                 :attributes => {
+                   :action => "/projects/subproject1/repository/test-diff-path/" + 
+                                "revisions/61b685fbe55ab05b/diff"
+                 }
+      assert_tag :tag => 'input',
+                 :attributes => {
+                   :id => "rev_to",
+                   :name => "rev_to",
+                   :type => "hidden",
+                   :value => '2f9c0091c754a91a'
+                 }
+    end
+
     def test_diff_latin_1
       if @ruby19_non_utf8_pass
         puts_ruby19_non_utf8_pass()