summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/roles_controller_test.rb4
-rw-r--r--test/functional/workflows_controller_test.rb7
-rw-r--r--test/unit/helpers/application_helper_test.rb2
-rw-r--r--test/unit/issue_nested_set_test.rb2
-rw-r--r--test/unit/project_test.rb4
-rw-r--r--test/unit/repository_bazaar_test.rb2
-rw-r--r--test/unit/repository_cvs_test.rb2
-rw-r--r--test/unit/repository_darcs_test.rb2
-rw-r--r--test/unit/repository_mercurial_test.rb2
-rw-r--r--test/unit/repository_subversion_test.rb2
10 files changed, 16 insertions, 13 deletions
diff --git a/test/functional/roles_controller_test.rb b/test/functional/roles_controller_test.rb
index 8aa74457a..68c573ac6 100644
--- a/test/functional/roles_controller_test.rb
+++ b/test/functional/roles_controller_test.rb
@@ -34,7 +34,7 @@ class RolesControllerTest < ActionController::TestCase
assert_template 'index'
assert_not_nil assigns(:roles)
- assert_equal Role.find(:all, :order => 'builtin, position'), assigns(:roles)
+ assert_equal Role.order('builtin, position').all, assigns(:roles)
assert_tag :tag => 'a', :attributes => { :href => '/roles/1/edit' },
:content => 'Manager'
@@ -163,7 +163,7 @@ class RolesControllerTest < ActionController::TestCase
assert_template 'permissions'
assert_not_nil assigns(:roles)
- assert_equal Role.find(:all, :order => 'builtin, position'), assigns(:roles)
+ assert_equal Role.order('builtin, position').all, assigns(:roles)
assert_tag :tag => 'input', :attributes => { :type => 'checkbox',
:name => 'permissions[3][]',
diff --git a/test/functional/workflows_controller_test.rb b/test/functional/workflows_controller_test.rb
index a7d67822d..6ec743161 100644
--- a/test/functional/workflows_controller_test.rb
+++ b/test/functional/workflows_controller_test.rb
@@ -306,7 +306,10 @@ class WorkflowsControllerTest < ActionController::TestCase
# Returns an array of status transitions that can be compared
def status_transitions(conditions)
- WorkflowTransition.find(:all, :conditions => conditions,
- :order => 'tracker_id, role_id, old_status_id, new_status_id').collect {|w| [w.old_status, w.new_status_id]}
+ WorkflowTransition.
+ where(conditions).
+ order('tracker_id, role_id, old_status_id, new_status_id').
+ all.
+ collect {|w| [w.old_status, w.new_status_id]}
end
end
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