Commit 373dff1a authored by tmaruyama's avatar tmaruyama

test: switch to Rails3 Active Record syntax at test_destroy of unit/repository_test.rb

git-svn-id: https://svn.redmine.org/redmine/trunk@9623 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 15b788ba
......@@ -98,9 +98,8 @@ class RepositoryTest < ActiveSupport::TestCase
end
def test_destroy
changesets = Changeset.count(:all, :conditions => "repository_id = 10")
changes = Change.count(:all, :conditions => "repository_id = 10",
:joins => :changeset)
changesets = Changeset.where("repository_id = 10").all.count
changes = Changeset.joins([:changes]).where("repository_id = 10").all.count
assert_difference 'Changeset.count', -changesets do
assert_difference 'Change.count', -changes do
Repository.find(10).destroy
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment