diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-02 20:23:48 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-02 20:23:48 +0000 |
commit | 536747b74708188848d85d8de5df34e7aa762006 (patch) | |
tree | c7cfe03314c047dff313825c8548d056e5e1af29 /test/unit | |
parent | 96fca0b08f6d60e8736e8e3f95a5d0ae33779068 (diff) | |
download | redmine-536747b74708188848d85d8de5df34e7aa762006.tar.gz redmine-536747b74708188848d85d8de5df34e7aa762006.zip |
Replaces find(:all) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10917 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 2 | ||||
-rw-r--r-- | test/unit/issue_nested_set_test.rb | 2 | ||||
-rw-r--r-- | test/unit/project_test.rb | 4 | ||||
-rw-r--r-- | test/unit/repository_bazaar_test.rb | 2 | ||||
-rw-r--r-- | test/unit/repository_cvs_test.rb | 2 | ||||
-rw-r--r-- | test/unit/repository_darcs_test.rb | 2 | ||||
-rw-r--r-- | test/unit/repository_mercurial_test.rb | 2 | ||||
-rw-r--r-- | test/unit/repository_subversion_test.rb | 2 |
8 files changed, 9 insertions, 9 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 40a85473e..e9ecc4328 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -139,7 +139,7 @@ RAW # link image '!logo.gif!:http://foo.bar/' => '<a href="http://foo.bar/"><img src="/attachments/download/3" title="This is a logo" alt="This is a logo" /></a>', } - attachments = Attachment.find(:all) + attachments = Attachment.all to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text, :attachments => attachments) } end diff --git a/test/unit/issue_nested_set_test.rb b/test/unit/issue_nested_set_test.rb index d796edf94..25f02c5bc 100644 --- a/test/unit/issue_nested_set_test.rb +++ b/test/unit/issue_nested_set_test.rb @@ -367,7 +367,7 @@ class IssueNestedSetTest < ActiveSupport::TestCase c.reload assert_equal 5, c.issues.count - ic1, ic2, ic3, ic4, ic5 = c.issues.find(:all, :order => 'subject') + ic1, ic2, ic3, ic4, ic5 = c.issues.order('subject').all assert ic1.root? assert_equal ic1, ic2.parent assert_equal ic1, ic3.parent diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb index 30b3f0d6a..28a478e60 100644 --- a/test/unit/project_test.rb +++ b/test/unit/project_test.rb @@ -183,7 +183,7 @@ class ProjectTest < ActiveSupport::TestCase # 2 active members assert_equal 2, @ecookbook.members.size # and 1 is locked - assert_equal 3, Member.find(:all, :conditions => ['project_id = ?', @ecookbook.id]).size + assert_equal 3, Member.where('project_id = ?', @ecookbook.id).all.size # some boards assert @ecookbook.boards.any? @@ -693,7 +693,7 @@ class ProjectTest < ActiveSupport::TestCase def test_activities_should_use_the_system_activities project = Project.find(1) - assert_equal project.activities, TimeEntryActivity.find(:all, :conditions => {:active => true} ) + assert_equal project.activities, TimeEntryActivity.where(:active => true).all end diff --git a/test/unit/repository_bazaar_test.rb b/test/unit/repository_bazaar_test.rb index 656161a74..94ed9858e 100644 --- a/test/unit/repository_bazaar_test.rb +++ b/test/unit/repository_bazaar_test.rb @@ -105,7 +105,7 @@ class RepositoryBazaarTest < ActiveSupport::TestCase @project.reload assert_equal NUM_REV, @repository.changesets.count # Remove changesets with revision > 5 - @repository.changesets.find(:all).each {|c| c.destroy if c.revision.to_i > 2} + @repository.changesets.all.each {|c| c.destroy if c.revision.to_i > 2} @project.reload assert_equal 2, @repository.changesets.count diff --git a/test/unit/repository_cvs_test.rb b/test/unit/repository_cvs_test.rb index b718246b2..05f59d8a6 100644 --- a/test/unit/repository_cvs_test.rb +++ b/test/unit/repository_cvs_test.rb @@ -116,7 +116,7 @@ class RepositoryCvsTest < ActiveSupport::TestCase assert_equal CHANGESETS_NUM, @repository.changesets.count # Remove changesets with revision > 3 - @repository.changesets.find(:all).each {|c| c.destroy if c.revision.to_i > 3} + @repository.changesets.all.each {|c| c.destroy if c.revision.to_i > 3} @project.reload assert_equal 3, @repository.changesets.count assert_equal %w|3 2 1|, @repository.changesets.all.collect(&:revision) diff --git a/test/unit/repository_darcs_test.rb b/test/unit/repository_darcs_test.rb index 53c91abb3..b1007580e 100644 --- a/test/unit/repository_darcs_test.rb +++ b/test/unit/repository_darcs_test.rb @@ -79,7 +79,7 @@ class RepositoryDarcsTest < ActiveSupport::TestCase assert_equal NUM_REV, @repository.changesets.count # Remove changesets with revision > 3 - @repository.changesets.find(:all).each {|c| c.destroy if c.revision.to_i > 3} + @repository.changesets.all.each {|c| c.destroy if c.revision.to_i > 3} @project.reload assert_equal 3, @repository.changesets.count diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb index f64300748..00201efc2 100644 --- a/test/unit/repository_mercurial_test.rb +++ b/test/unit/repository_mercurial_test.rb @@ -102,7 +102,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase @project.reload assert_equal NUM_REV, @repository.changesets.count # Remove changesets with revision > 2 - @repository.changesets.find(:all).each {|c| c.destroy if c.revision.to_i > 2} + @repository.changesets.all.each {|c| c.destroy if c.revision.to_i > 2} @project.reload assert_equal 3, @repository.changesets.count diff --git a/test/unit/repository_subversion_test.rb b/test/unit/repository_subversion_test.rb index e2550453a..0783b16e6 100644 --- a/test/unit/repository_subversion_test.rb +++ b/test/unit/repository_subversion_test.rb @@ -47,7 +47,7 @@ class RepositorySubversionTest < ActiveSupport::TestCase assert_equal NUM_REV, @repository.changesets.count # Remove changesets with revision > 5 - @repository.changesets.find(:all).each {|c| c.destroy if c.revision.to_i > 5} + @repository.changesets.all.each {|c| c.destroy if c.revision.to_i > 5} @project.reload assert_equal 5, @repository.changesets.count |