summaryrefslogtreecommitdiffstats
path: root/test/unit/project_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-06-12 19:13:25 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-06-12 19:13:25 +0000
commitf9ddb562d58ae98bcc69f74396b028cbc8cce0b1 (patch)
tree8019be9178fb3d14c764c04e3e3a5be955de1385 /test/unit/project_test.rb
parent136cdc765afda57b9be02704e52b27334da42c73 (diff)
downloadredmine-f9ddb562d58ae98bcc69f74396b028cbc8cce0b1.tar.gz
redmine-f9ddb562d58ae98bcc69f74396b028cbc8cce0b1.zip
Cleanup of finders with :conditions option.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11963 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/project_test.rb')
-rw-r--r--test/unit/project_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index c6ba4cd72..88e99c439 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -175,7 +175,7 @@ class ProjectTest < ActiveSupport::TestCase
# Assign an issue of a project to a version of a child project
Issue.find(4).update_attribute :fixed_version_id, 4
- assert_no_difference "Project.count(:all, :conditions => 'status = #{Project::STATUS_ARCHIVED}')" do
+ assert_no_difference "Project.where(:status => Project::STATUS_ARCHIVED).count" do
assert_equal false, @ecookbook.archive
end
@ecookbook.reload
@@ -211,9 +211,9 @@ class ProjectTest < ActiveSupport::TestCase
# make sure that the project non longer exists
assert_raise(ActiveRecord::RecordNotFound) { Project.find(@ecookbook.id) }
# make sure related data was removed
- assert_nil Member.first(:conditions => {:project_id => @ecookbook.id})
- assert_nil Board.first(:conditions => {:project_id => @ecookbook.id})
- assert_nil Issue.first(:conditions => {:project_id => @ecookbook.id})
+ assert_nil Member.where(:project_id => @ecookbook.id).first
+ assert_nil Board.where(:project_id => @ecookbook.id).first
+ assert_nil Issue.where(:project_id => @ecookbook.id).first
end
def test_destroy_should_destroy_subtasks
@@ -246,7 +246,7 @@ class ProjectTest < ActiveSupport::TestCase
assert_equal 0, Board.count
assert_equal 0, Message.count
assert_equal 0, News.count
- assert_equal 0, Query.count(:conditions => "project_id IS NOT NULL")
+ assert_equal 0, Query.where("project_id IS NOT NULL").count
assert_equal 0, Repository.count
assert_equal 0, Changeset.count
assert_equal 0, Change.count
@@ -260,7 +260,7 @@ class ProjectTest < ActiveSupport::TestCase
assert_equal 0, WikiContent::Version.count
assert_equal 0, Project.connection.select_all("SELECT * FROM projects_trackers").size
assert_equal 0, Project.connection.select_all("SELECT * FROM custom_fields_projects").size
- assert_equal 0, CustomValue.count(:conditions => {:customized_type => ['Project', 'Issue', 'TimeEntry', 'Version']})
+ assert_equal 0, CustomValue.where(:customized_type => ['Project', 'Issue', 'TimeEntry', 'Version']).count
end
def test_move_an_orphan_project_to_a_root_project