summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-03 17:17:50 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-03 17:17:50 +0000
commit3faa3693d16207a0398adb389f244c6de396e271 (patch)
tree8cb96c0b58bfcc9e5e88fb3c4057418a63e81d98 /test
parentddef0ad7c164c8eee4a9832fe8fbce1fb538745a (diff)
downloadredmine-3faa3693d16207a0398adb389f244c6de396e271.tar.gz
redmine-3faa3693d16207a0398adb389f244c6de396e271.zip
Test failures.
git-svn-id: http://svn.redmine.org/redmine/trunk@16359 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/lib/redmine/field_format/version_field_format_test.rb5
-rw-r--r--test/unit/project_test.rb3
-rw-r--r--test/unit/time_entry_query_test.rb16
3 files changed, 16 insertions, 8 deletions
diff --git a/test/unit/lib/redmine/field_format/version_field_format_test.rb b/test/unit/lib/redmine/field_format/version_field_format_test.rb
index 22aeeb285..ca7827987 100644
--- a/test/unit/lib/redmine/field_format/version_field_format_test.rb
+++ b/test/unit/lib/redmine/field_format/version_field_format_test.rb
@@ -24,6 +24,11 @@ class Redmine::VersionFieldFormatTest < ActionView::TestCase
:issue_statuses, :issue_categories, :issue_relations, :workflows,
:enumerations
+ def setup
+ super
+ User.current = nil
+ end
+
def test_version_status_should_reject_blank_values
field = IssueCustomField.new(:name => 'Foo', :field_format => 'version', :version_status => ["open", ""])
field.save!
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index b740ee649..66d6fa3b2 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -37,7 +37,8 @@ class ProjectTest < ActiveSupport::TestCase
:repositories,
:news, :comments,
:documents,
- :workflows
+ :workflows,
+ :attachments
def setup
@ecookbook = Project.find(1)
diff --git a/test/unit/time_entry_query_test.rb b/test/unit/time_entry_query_test.rb
index 317f037d0..f60091cb9 100644
--- a/test/unit/time_entry_query_test.rb
+++ b/test/unit/time_entry_query_test.rb
@@ -68,13 +68,15 @@ class TimeEntryQueryTest < ActiveSupport::TestCase
TimeEntry.generate!(:activity => override, :hours => 2.0)
TimeEntry.generate!(:activity => other, :hours => 4.0)
- query = TimeEntryQuery.new(:name => '_')
- query.add_filter('activity_id', '=', [system.id.to_s])
- assert_equal 3.0, query.results_scope.sum(:hours)
-
- query = TimeEntryQuery.new(:name => '_')
- query.add_filter('activity_id', '!', [system.id.to_s])
- assert_equal 4.0, query.results_scope.sum(:hours)
+ with_current_user User.find(2) do
+ query = TimeEntryQuery.new(:name => '_')
+ query.add_filter('activity_id', '=', [system.id.to_s])
+ assert_equal 3.0, query.results_scope.sum(:hours)
+
+ query = TimeEntryQuery.new(:name => '_')
+ query.add_filter('activity_id', '!', [system.id.to_s])
+ assert_equal 4.0, query.results_scope.sum(:hours)
+ end
end
def test_project_query_should_include_project_issue_custom_fields_only_as_filters