summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/custom_fields_controller_test.rb2
-rw-r--r--test/functional/issues_controller_test.rb4
-rw-r--r--test/functional/projects_controller_test.rb2
-rw-r--r--test/functional/repositories_controller_test.rb2
-rw-r--r--test/functional/workflows_controller_test.rb8
5 files changed, 9 insertions, 9 deletions
diff --git a/test/functional/custom_fields_controller_test.rb b/test/functional/custom_fields_controller_test.rb
index c8193c5d4..c7efcfeb6 100644
--- a/test/functional/custom_fields_controller_test.rb
+++ b/test/functional/custom_fields_controller_test.rb
@@ -153,7 +153,7 @@ class CustomFieldsControllerTest < ActionController::TestCase
end
def test_destroy
- custom_values_count = CustomValue.count(:conditions => {:custom_field_id => 1})
+ custom_values_count = CustomValue.where(:custom_field_id => 1).count
assert custom_values_count > 0
assert_difference 'CustomField.count', -1 do
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index e9afa9b0f..707b57438 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -3701,7 +3701,7 @@ class IssuesControllerTest < ActionController::TestCase
def test_bulk_copy_should_allow_changing_the_issue_attributes
# Fixes random test failure with Mysql
- # where Issue.all(:limit => 2, :order => 'id desc', :conditions => {:project_id => 2})
+ # where Issue.where(:project_id => 2).limit(2).order('id desc')
# doesn't return the expected results
Issue.delete_all("project_id=2")
@@ -3716,7 +3716,7 @@ class IssuesControllerTest < ActionController::TestCase
end
end
- copied_issues = Issue.all(:limit => 2, :order => 'id desc', :conditions => {:project_id => 2})
+ copied_issues = Issue.where(:project_id => 2).limit(2).order('id desc').to_a
assert_equal 2, copied_issues.size
copied_issues.each do |issue|
assert_equal 2, issue.project_id, "Project is incorrect"
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index 29de3df3c..37010cc71 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -51,7 +51,7 @@ class ProjectsControllerTest < ActionController::TestCase
assert_response :success
assert_template 'common/feed'
assert_select 'feed>title', :text => 'Redmine: Latest projects'
- assert_select 'feed>entry', :count => Project.count(:conditions => Project.visible_condition(User.current))
+ assert_select 'feed>entry', :count => Project.visible(User.current).count
end
test "#index by non-admin user with view_time_entries permission should show overall spent time link" do
diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb
index 2231e3134..ec1847fcd 100644
--- a/test/functional/repositories_controller_test.rb
+++ b/test/functional/repositories_controller_test.rb
@@ -280,7 +280,7 @@ class RepositoriesControllerTest < ActionController::TestCase
:revision => 100,
:comments => 'Committed by foo.'
)
- assert_no_difference "Changeset.count(:conditions => 'user_id = 3')" do
+ assert_no_difference "Changeset.where(:user_id => 3).count" do
post :committers, :id => 10, :committers => { '0' => ['foo', '2'], '1' => ['dlopper', '3']}
assert_response 302
assert_equal User.find(2), c.reload.user
diff --git a/test/functional/workflows_controller_test.rb b/test/functional/workflows_controller_test.rb
index d04c3ec0a..f5bf3910b 100644
--- a/test/functional/workflows_controller_test.rb
+++ b/test/functional/workflows_controller_test.rb
@@ -30,7 +30,7 @@ class WorkflowsControllerTest < ActionController::TestCase
assert_response :success
assert_template 'index'
- count = WorkflowTransition.count(:all, :conditions => 'role_id = 1 AND tracker_id = 2')
+ count = WorkflowTransition.where(:role_id => 1, :tracker_id => 2).count
assert_tag :tag => 'a', :content => count.to_s,
:attributes => { :href => '/workflows/edit?role_id=1&amp;tracker_id=2' }
end
@@ -125,10 +125,10 @@ class WorkflowsControllerTest < ActionController::TestCase
end
def test_clear_workflow
- assert WorkflowTransition.count(:conditions => {:tracker_id => 1, :role_id => 2}) > 0
+ assert WorkflowTransition.where(:role_id => 1, :tracker_id => 2).count > 0
- post :edit, :role_id => 2, :tracker_id => 1
- assert_equal 0, WorkflowTransition.count(:conditions => {:tracker_id => 1, :role_id => 2})
+ post :edit, :role_id => 1, :tracker_id => 2
+ assert_equal 0, WorkflowTransition.where(:role_id => 1, :tracker_id => 2).count
end
def test_get_permissions