]> source.dussan.org Git - redmine.git/commitdiff
Rails3: scm: mercurial: fix error of test_destroy_invalid_repository at functional...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 12 Sep 2011 14:02:59 +0000 (14:02 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 12 Sep 2011 14:02:59 +0000 (14:02 +0000)
On Rails 3.1, ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection error raises.
For more details, see r7062.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7206 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/repositories_mercurial_controller_test.rb

index 2a63ac4d695d6da1ab1c0ba2249827cf54a419f9..881b595e9519eccd0509fdf7d9db7a1a9eb5fba6 100644 (file)
@@ -456,9 +456,10 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
 
     def test_destroy_invalid_repository
       @request.session[:user_id] = 1 # admin
+      assert_equal 0, @repository.changesets.count
       @repository.fetch_changesets
-      @repository.reload
-      assert @repository.changesets.count > 0
+      @project.reload
+      assert_equal NUM_REV, @repository.changesets.count
 
       get :destroy, :id => PRJ_ID
       assert_response 302
@@ -472,7 +473,7 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
                       )
       assert @repository
       @repository.fetch_changesets
-      @repository.reload
+      @project.reload
       assert_equal 0, @repository.changesets.count
 
       get :destroy, :id => PRJ_ID