]> source.dussan.org Git - redmine.git/commitdiff
Merged r17761 from trunk to 4.0-stable (#32022).
authorGo MAEDA <maeda@farend.jp>
Thu, 5 Sep 2019 05:58:15 +0000 (05:58 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 5 Sep 2019 05:58:15 +0000 (05:58 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/4.0-stable@18432 e93f8b46-1217-0410-a6f0-8f06a7374b81

63 files changed:
test/unit/activity_test.rb
test/unit/attachment_transaction_test.rb
test/unit/auth_source_ldap_test.rb
test/unit/board_test.rb
test/unit/changeset_test.rb
test/unit/comment_test.rb
test/unit/custom_field_user_format_test.rb
test/unit/custom_field_version_format_test.rb
test/unit/custom_value_test.rb
test/unit/default_data_test.rb
test/unit/document_category_test.rb
test/unit/enabled_module_test.rb
test/unit/enumeration_test.rb
test/unit/group_test.rb
test/unit/issue_category_test.rb
test/unit/issue_custom_field_test.rb
test/unit/issue_import_test.rb
test/unit/issue_nested_set_concurrency_test.rb
test/unit/issue_priority_test.rb
test/unit/issue_relation_test.rb
test/unit/issue_scopes_test.rb
test/unit/issue_status_test.rb
test/unit/issue_subtasking_test.rb
test/unit/issue_transaction_test.rb
test/unit/journal_observer_test.rb
test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb
test/unit/lib/redmine/field_format/bool_format_test.rb
test/unit/lib/redmine/field_format/enumeration_format_test.rb
test/unit/lib/redmine/field_format/field_format_test.rb
test/unit/lib/redmine/field_format/link_format_test.rb
test/unit/lib/redmine/field_format/list_format_test.rb
test/unit/lib/redmine/field_format/numeric_format_test.rb
test/unit/lib/redmine/field_format/user_field_format_test.rb
test/unit/member_test.rb
test/unit/message_test.rb
test/unit/news_test.rb
test/unit/project_members_inheritance_test.rb
test/unit/project_nested_set_concurrency_test.rb
test/unit/project_nested_set_test.rb
test/unit/repository_bazaar_test.rb
test/unit/repository_cvs_test.rb
test/unit/repository_filesystem_test.rb
test/unit/repository_git_test.rb
test/unit/repository_mercurial_test.rb
test/unit/repository_subversion_test.rb
test/unit/repository_test.rb
test/unit/role_test.rb
test/unit/search_test.rb
test/unit/setting_test.rb
test/unit/time_entry_activity_test.rb
test/unit/time_entry_query_test.rb
test/unit/token_test.rb
test/unit/tracker_test.rb
test/unit/user_preference_test.rb
test/unit/version_test.rb
test/unit/watcher_test.rb
test/unit/wiki_content_test.rb
test/unit/wiki_content_version_test.rb
test/unit/wiki_page_test.rb
test/unit/wiki_redirect_test.rb
test/unit/wiki_test.rb
test/unit/workflow_test.rb
test/unit/workflow_transition_test.rb

index a14203d4cb654431598688ad638afde575cf60b2..3c14021735a672b6d82c40c20212b0c739bc78a9 100644 (file)
@@ -23,6 +23,7 @@ class ActivityTest < ActiveSupport::TestCase
            :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
 
   def setup
+    User.current = nil
     @project = Project.find(1)
   end
 
index b0f13332f7948e93ea6e340c7cbf1b003cde5655..173d2a658fe9154353a24551053a60736470f8cb 100644 (file)
@@ -26,6 +26,7 @@ class AttachmentTest < ActiveSupport::TestCase
   self.use_transactional_tests = false
 
   def setup
+    User.current = nil
     set_tmp_attachments_directory
   end
 
index f6eefed0268a7aff5286ecff7c27267a9b94ea8c..322568226f4b4c147f0c469c36f2406601ae1c5b 100644 (file)
@@ -22,6 +22,7 @@ class AuthSourceLdapTest < ActiveSupport::TestCase
   fixtures :auth_sources
 
   def setup
+    User.current = nil
   end
 
   def test_initialize
index c66e7007192b8362bb3e1a044623e841cdb80300..35c2da9fabf497e1ec9164bc86cb710f551eb106 100644 (file)
@@ -25,6 +25,7 @@ class BoardTest < ActiveSupport::TestCase
   include Redmine::I18n
 
   def setup
+    User.current = nil
     @project = Project.find(1)
   end
 
index a1c3cf8dc6eb2d8b511d97d964ec538ea4c5f37d..c246a0c709d73c3bc3bb30dad045e37bedf5d45d 100644 (file)
@@ -32,6 +32,10 @@ class ChangesetTest < ActiveSupport::TestCase
            :trackers, :projects_trackers,
            :enabled_modules, :roles
 
+  def setup
+    User.current = nil
+  end
+
   def test_ref_keywords_any
     ActionMailer::Base.deliveries.clear
     Setting.commit_ref_keywords = '*'
index 1821738669d63869dcecd46133aace02463cb4f9..6e97df6123d255d4b0baa91053f435e5caa2ddb8 100644 (file)
@@ -22,6 +22,7 @@ class CommentTest < ActiveSupport::TestCase
            :user_preferences, :roles, :members, :member_roles
 
   def setup
+    User.current = nil
     @jsmith = User.find(2)
     @news = News.find(1)
   end
index 8827e9737dda817eba65a49c7b698868c89d71b0..a3d161de3c900c99eeb34d6eb13bd03a562a2947 100644 (file)
@@ -21,6 +21,7 @@ class CustomFieldUserFormatTest < ActiveSupport::TestCase
   fixtures :custom_fields, :projects, :members, :users, :member_roles, :trackers, :issues
 
   def setup
+    User.current = nil
     @field = IssueCustomField.create!(:name => 'Tester', :field_format => 'user')
   end
 
index 761d0ab5bbcbf53cb012f56fc15fd948cb3e7ecd..4e09bed05422bab04127a70cb7a3bbab7b0d9f4c 100644 (file)
@@ -21,6 +21,7 @@ class CustomFieldVersionFormatTest < ActiveSupport::TestCase
   fixtures :custom_fields, :projects, :members, :users, :member_roles, :trackers, :issues, :versions
 
   def setup
+    User.current = nil
     @field = IssueCustomField.create!(:name => 'Tester', :field_format => 'version')
   end
 
index b22cc42259ddac79ddc54cd808ce3711b876a59d..14964ed09e158d0ef8140e5ca7fd3a98b333e7b7 100644 (file)
@@ -20,6 +20,10 @@ require File.expand_path('../../test_helper', __FILE__)
 class CustomValueTest < ActiveSupport::TestCase
   fixtures :custom_fields, :custom_values, :users
 
+  def setup
+    User.current = nil
+  end
+
   def test_new_without_value_should_set_default_value
     field = CustomField.generate!(:default_value => 'Default string')
 
index f7aea768557b91abea56b8917eb1254c9ffd8194..6a6a223bda13ead3d87f8c076edf8f7ba2a960d9 100644 (file)
@@ -21,6 +21,10 @@ class DefaultDataTest < ActiveSupport::TestCase
   include Redmine::I18n
   fixtures :roles
 
+  def setup
+    User.current = nil
+  end
+
   def test_no_data
     assert !Redmine::DefaultData::Loader::no_data?
     clear_data
index 6a9eb09352c3c7c6b122b1c7ab44b0ca14e33b8a..305d827da0b143b52406cc369da8253e8f7c7cf8 100644 (file)
@@ -20,6 +20,10 @@ require File.expand_path('../../test_helper', __FILE__)
 class DocumentCategoryTest < ActiveSupport::TestCase
   fixtures :enumerations, :documents, :issues
 
+  def setup
+    User.current = nil
+  end
+
   def test_should_be_an_enumeration
     assert DocumentCategory.ancestors.include?(Enumeration)
   end
index eae68fbc80d196de4c03cd01d5b5b457b05d5826..79995dbf2376ee9b27119cd19a703e6acfac6c90 100644 (file)
@@ -20,6 +20,10 @@ require File.expand_path('../../test_helper', __FILE__)
 class EnabledModuleTest < ActiveSupport::TestCase
   fixtures :projects, :trackers, :issue_statuses, :wikis
 
+  def setup
+    User.current = nil
+  end
+
   def test_enabling_wiki_should_create_a_wiki
     CustomField.delete_all
     project = Project.create!(:name => 'Project with wiki', :identifier => 'wikiproject', :enabled_module_names => [])
index 3efba77b748c1126b9aa15482e2cea3ecae34672..7eeafd2afcce4c2ab14476a1cf190d3e4965ba67 100644 (file)
@@ -20,6 +20,10 @@ require File.expand_path('../../test_helper', __FILE__)
 class EnumerationTest < ActiveSupport::TestCase
   fixtures :enumerations, :issues, :custom_fields, :custom_values
 
+  def setup
+    User.current = nil
+  end
+
   def test_objects_count
     # low priority
     assert_equal 6, Enumeration.find(4).objects_count
index 8756f31e7dcb91a66c559a130ac42b2922d0b331..f706826cecd58e7fe96a25abd3ec7888f654a392 100644 (file)
@@ -28,6 +28,10 @@ class GroupTest < ActiveSupport::TestCase
 
   include Redmine::I18n
 
+  def setup
+    User.current = nil
+  end
+
   def test_create
     g = Group.new(:name => 'New group')
     assert g.save
index 1340ea84f67fd93e229972dcc5c78071b0403453..2d03168823e8fbc8a354c6d6e141ae076dcc76df 100644 (file)
@@ -21,6 +21,7 @@ class IssueCategoryTest < ActiveSupport::TestCase
   fixtures :issue_categories, :issues, :users, :groups_users
 
   def setup
+    User.current = nil
     @category = IssueCategory.find(1)
   end
 
index 107d47d82e9df1d14853695b9275ee0986205304..4ecce3b5ed0d4e672cd3518f17242c1831844b11 100644 (file)
@@ -22,6 +22,11 @@ class IssueCustomFieldTest < ActiveSupport::TestCase
 
   fixtures :roles
 
+  def setup
+    User.current = nil
+    @category = IssueCategory.find(1)
+  end
+
   def test_custom_field_with_visible_set_to_false_should_validate_roles
     set_language_if_valid 'en'
     field = IssueCustomField.new(:name => 'Field', :field_format => 'string', :visible => false)
index 7530045fa0511f3328a9b3db997e1e501d1fdbdb..fe4a04872e590a119cdc4d280371383dba1f5fab 100644 (file)
@@ -35,6 +35,7 @@ class IssueImportTest < ActiveSupport::TestCase
   include Redmine::I18n
 
   def setup
+    User.current = nil
     set_language_if_valid 'en'
   end
 
index 125131eae2a10edc617844205ec8627a44612290..b35cbadbd736b6f6e1c3248defd102357206097f 100644 (file)
@@ -28,6 +28,7 @@ class IssueNestedSetConcurrencyTest < ActiveSupport::TestCase
 
   def setup
     skip if sqlite? || mysql?
+    User.current = nil
     CustomField.delete_all
   end
 
index 0617506f15caeb54055aff16aadc250782d1aa3b..3141344f4ef4df79c634b841d4f937560581b41b 100644 (file)
@@ -20,6 +20,10 @@ require File.expand_path('../../test_helper', __FILE__)
 class IssuePriorityTest < ActiveSupport::TestCase
   fixtures :enumerations, :issues
 
+  def setup
+    User.current = nil
+  end
+
   def test_named_scope
     assert_equal Enumeration.find_by_name('Normal'), Enumeration.named('normal').first
   end
index 585a8293e721261c3c1cd3b1401b4af06e866c56..6e63228850373c8af704bac6602288fc09441dc9 100644 (file)
@@ -33,6 +33,10 @@ class IssueRelationTest < ActiveSupport::TestCase
 
   include Redmine::I18n
 
+  def setup
+    User.current = nil
+  end
+
   def test_create
     from = Issue.find(1)
     to = Issue.find(2)
index f8460b9e02ce8c48ad2f003a03997109cbc362d7..19253645f6b212dbea9f5fe36b9030360a18b05a 100644 (file)
@@ -26,6 +26,10 @@ class IssueScopesTest < ActiveSupport::TestCase
            :issues,
            :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values
 
+  def setup
+    User.current = nil
+  end
+
   def test_cross_project_scope_without_project_should_return_all_issues
     ids = Issue.cross_project_scope(nil).pluck(:id).sort
     assert_equal Issue.pluck(:id).sort, ids
index 52b65900ab1a933c89d6ef5ba66a668422bc430a..27441366f2540c280dff0240ceb63d918014914d 100644 (file)
@@ -28,6 +28,10 @@ class IssueStatusTest < ActiveSupport::TestCase
            :issues, :journals, :journal_details,
            :custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values
 
+  def setup
+    User.current = nil
+  end
+
   def test_create
     status = IssueStatus.new :name => "Assigned"
     assert !status.save
index c54586d70fd2da23d6dad53500dd3b47aee72c7d..6ad720d33feff5a1a32e7d61220b01d0c56ef120 100644 (file)
@@ -25,6 +25,10 @@ class IssueSubtaskingTest < ActiveSupport::TestCase
            :enabled_modules,
            :workflows
 
+  def setup
+    User.current = nil
+  end
+
   def test_leaf_planning_fields_should_be_editable
     issue = Issue.generate!
     user = User.find(1)
index f944ffe8e84ca78aa6a80777f7cae373911da8e5..719e4dbc530f6ed408b996b559a0fb186352e570 100644 (file)
@@ -29,6 +29,10 @@ class IssueTransactionTest < ActiveSupport::TestCase
 
   self.use_transactional_tests = false
 
+  def setup
+    User.current = nil
+  end
+
   def test_invalid_move_to_another_project
     lft1 = new_issue_lft
     parent1 = Issue.generate!
index 17695538aa0edeac75a4b01c5fc581e15caa3464..a03fa402b8d3cef2ae17cd545de46b82294657e7 100644 (file)
@@ -23,6 +23,7 @@ class JournalObserverTest < ActiveSupport::TestCase
            :users, :email_addresses, :roles
 
   def setup
+    User.current = nil
     ActionMailer::Base.deliveries.clear
     @journal = Journal.find 1
   end
index 4ce4062bb7bf8bea5907a0a509f76ba807d926dc..8d883f95a3746996ff4feb3bf3a33b9c1251d14a 100644 (file)
@@ -26,6 +26,7 @@ class AttachmentFormatVisibilityTest < ActionView::TestCase
            :versions, :issues
 
   def setup
+    User.current = nil
     set_tmp_attachments_directory
   end
 
index 9041c81e88006592d944739099cdcfc065c883a9..2458de1ed1512cc20bc303d04727c4ad7d208e33 100644 (file)
@@ -23,6 +23,7 @@ class Redmine::BoolFieldFormatTest < ActionView::TestCase
   include Redmine::I18n
 
   def setup
+    User.current = nil
     set_language_if_valid 'en'
   end
 
index bc9a498d10417f9d635d0cf9d7d3c8a49eacc37a..9b977b221d25c23de5dd5baf9cae5e19d73928b2 100644 (file)
@@ -22,6 +22,7 @@ class Redmine::EnumerationFieldFormatTest < ActionView::TestCase
   include ApplicationHelper
 
   def setup
+    User.current = nil
     set_language_if_valid 'en'
     @field = IssueCustomField.create!(:name => 'List', :field_format => 'enumeration', :is_required => false)
     @foo = CustomFieldEnumeration.new(:name => 'Foo')
index f066389446d974b01b710c7767a2403f624475b0..7d98f25854ce6e55cb59b2356820b131ed0afe7f 100644 (file)
@@ -21,6 +21,7 @@ class Redmine::FieldFormatTest < ActionView::TestCase
   include ApplicationHelper
 
   def setup
+    User.current = nil
     set_language_if_valid 'en'
   end
 
index d5758be17270e6999becd3a618a7eb0981734336..aa7e8de52ffbbcd87946014b54bc17cffa18c883 100644 (file)
@@ -19,6 +19,11 @@ require File.expand_path('../../../../../test_helper', __FILE__)
 require 'redmine/field_format'
 
 class Redmine::LinkFieldFormatTest < ActionView::TestCase
+
+  def setup
+    User.current = nil
+  end
+
   def test_link_field_should_substitute_value
     field = IssueCustomField.new(:field_format => 'link', :url_pattern => 'http://foo/%value%')
     custom_value = CustomValue.new(:custom_field => field, :customized => Issue.new, :value => "bar")
index 8a19e3527e320b14f6955e6695ec5e5e30cd1675..06a7fbda44fd01674b1ed6a988f5c2a8f8ef5e37 100644 (file)
@@ -23,6 +23,7 @@ class Redmine::ListFieldFormatTest < ActionView::TestCase
   include Redmine::I18n
 
   def setup
+    User.current = nil
     set_language_if_valid 'en'
   end
 
index e6572d8c694b4a4f8e20bad1f3cf6b4ddc5cf24b..72e2148d505897943746d5544d5624f877ca7be2 100644 (file)
@@ -21,6 +21,10 @@ require 'redmine/field_format'
 class Redmine::NumericFieldFormatTest < ActionView::TestCase\r
   include ApplicationHelper\r
 \r
+  def setup\r
+    User.current = nil\r
+  end\r
+\r
   def test_integer_field_with_url_pattern_should_format_as_link\r
     field = IssueCustomField.new(:field_format => 'int', :url_pattern => 'http://foo/%value%')\r
     custom_value = CustomValue.new(:custom_field => field, :customized => Issue.new, :value => "3")\r
index 2612bb4754ae8be425c20da31bcac1910f9b6497..e545c6d4f6576cad45f3d6b85ef6930c21db0198 100644 (file)
@@ -25,6 +25,10 @@ class Redmine::UserFieldFormatTest < ActionView::TestCase
            :enumerations,
            :custom_fields, :custom_fields_trackers, :custom_fields_projects
 
+  def setup
+    User.current = nil
+  end
+
   def test_user_role_should_reject_blank_values
     field = IssueCustomField.new(:name => 'Foo', :field_format => 'user', :user_role => ["1", ""])
     field.save!
index ad804f64d18bae82789aa3662f313cf467018c78..ab6bf8473112cf344e2829af199b4d9eede10abd 100644 (file)
@@ -35,6 +35,7 @@ class MemberTest < ActiveSupport::TestCase
   include Redmine::I18n
 
   def setup
+    User.current = nil
     @jsmith = Member.find(1)
   end
 
index 254feb2181710ef4d83b4e936c17cb3b1af768cc..8d7073c2e6b908e0c9ce8cd46c4457429b468b5d 100644 (file)
@@ -22,6 +22,7 @@ class MessageTest < ActiveSupport::TestCase
            :users, :watchers, :enabled_modules
 
   def setup
+    User.current = nil
     @board = Board.find(1)
     @user = User.find(1)
   end
index 03a868a913cfb58687fa46a894e2f17686bb6d77..16e55dea3d97a393b0ee2d2a66464faa9d7b7918 100644 (file)
@@ -25,6 +25,7 @@ class NewsTest < ActiveSupport::TestCase
   end
 
   def setup
+    User.current = nil
   end
 
   def test_create_should_send_email_notification
index 849c22cb5b644efe0628fb24ecc52fcc5f6c6563..dde3d083c42dc5f297fede0fd83f2b5db8d85427 100644 (file)
@@ -22,6 +22,7 @@ class ProjectMembersInheritanceTest < ActiveSupport::TestCase
            :projects, :trackers, :issue_statuses
 
   def setup
+    User.current = nil
     @parent = Project.generate!
     @member = Member.create!(:principal => User.find(2), :project => @parent, :role_ids => [1, 2])
     assert_equal 2, @member.reload.roles.size
index 430aab1750589276cd01266d56378e0d80b26feb..771601333d917f53e09ecd14efad45d0d87590b3 100644 (file)
@@ -21,6 +21,7 @@ class ProjectNestedSetConcurrencyTest < ActiveSupport::TestCase
   self.use_transactional_tests = false
 
   def setup
+    User.current = nil
     CustomField.delete_all
   end
 
index fe31be205e4bf365e7fca90a9310e9b2692deb35..1f41f745f40301e9edd43849dd2fc963d3e30f7f 100644 (file)
@@ -20,6 +20,7 @@ require File.expand_path('../../test_helper', __FILE__)
 class ProjectNestedSetTest < ActiveSupport::TestCase
 
   def setup
+    User.current = nil
     Project.delete_all
     Tracker.delete_all
     EnabledModule.delete_all
index 51d18fe89a4233a1b198b0424989d72efa8a2f2e..4a5efbec359243b1e12b7b5f7041cfcf64d5b625 100644 (file)
@@ -48,6 +48,7 @@ class RepositoryBazaarTest < ActiveSupport::TestCase
   CHAR_1_LATIN1_HEX = "\xdc".force_encoding('ASCII-8BIT')
 
   def setup
+    User.current = nil
     @project = Project.find(3)
     @repository = Repository::Bazaar.create(
               :project => @project, :url => REPOSITORY_PATH_TRUNK,
index 2a111670f789fd6a37d0102c037930241fe01b5a..e2f4e04292b50d0ac4d77018ba9dbf06afd7892d 100644 (file)
@@ -29,6 +29,7 @@ class RepositoryCvsTest < ActiveSupport::TestCase
   CHANGESETS_NUM = 7
 
   def setup
+    User.current = nil
     @project = Project.find(3)
     @repository = Repository::Cvs.create(:project  => @project,
                                          :root_url => REPOSITORY_PATH,
index 5adcaa0d06d1b7615a5f98fbea68dc12afe5e075..be4223a6b6245fb11417af090b217d9458224d5f 100644 (file)
@@ -25,6 +25,7 @@ class RepositoryFilesystemTest < ActiveSupport::TestCase
   REPOSITORY_PATH = Rails.root.join('tmp/test/filesystem_repository').to_s
 
   def setup
+    User.current = nil
     @project = Project.find(3)
     Setting.enabled_scm << 'Filesystem' unless Setting.enabled_scm.include?('Filesystem')
     @repository = Repository::Filesystem.create(
index 4f223a96cc5c6d78de19472259e2293248f640da..1bdab9c99e8ba872b0f9ee092b952bc6a94c65bc 100644 (file)
@@ -40,6 +40,7 @@ class RepositoryGitTest < ActiveSupport::TestCase
   JRUBY_SKIP_STR = "TODO: This test fails in JRuby"
 
   def setup
+    User.current = nil
     @project = Project.find(3)
     @repository = Repository::Git.create(
                         :project       => @project,
index 1fa56c8bbef2c8d2144ed099e430012d72d0ab07..84403c84449cb64dd4b7aace965a93f563508f24 100644 (file)
@@ -29,6 +29,7 @@ class RepositoryMercurialTest < ActiveSupport::TestCase
   BRANCH_CHAR_1 = "branch-#{CHAR_1_HEX}-01".force_encoding('UTF-8')
 
   def setup
+    User.current = nil
     @project    = Project.find(3)
     @repository = Repository::Mercurial.create(
                       :project => @project,
index 309554f14e184f14edbe5a647ccb1990e1f09207..a17c12bb127b4d27ba4e83ccfa6b934573f33369 100644 (file)
@@ -25,6 +25,7 @@ class RepositorySubversionTest < ActiveSupport::TestCase
   NUM_REV = 11
 
   def setup
+    User.current = nil
     @project = Project.find(3)
     @repository = Repository::Subversion.create(:project => @project,
                     :url => self.class.subversion_repository_url)
index 9552d094846789ea0ec8a96a3fadd04523030981..65295e38f6e1c49b2f74ca02cc487ecee1f284ec 100644 (file)
@@ -38,6 +38,7 @@ class RepositoryTest < ActiveSupport::TestCase
   include Redmine::I18n
 
   def setup
+    User.current = nil
     @repository = Project.find(1).repository
   end
 
index d24010ea4728089480cfe5b73a5d51db4c265c57..ff723a34785ba8e944f292827cdceee5cc3621ad 100644 (file)
@@ -20,6 +20,10 @@ require File.expand_path('../../test_helper', __FILE__)
 class RoleTest < ActiveSupport::TestCase
   fixtures :roles, :workflows, :trackers
 
+  def setup
+    User.current = nil
+  end
+
   def test_sorted_scope
     assert_equal Role.all.sort, Role.sorted.to_a
   end
index a6ae15d0b79ed8138e1802bc30b77aad2d25a4a5..ecfbbcb9e61fe95f0f1ea5c7567a6b641bfeb7a5 100644 (file)
@@ -37,6 +37,7 @@ class SearchTest < ActiveSupport::TestCase
            :changesets
 
   def setup
+    User.current = nil
     @project = Project.find(1)
     @issue_keyword = '%unable to print recipes%'
     @issue = Issue.find(1)
index b65717dbe5cec0c1bf1b3a00ca46774513c3bebe..5eed249f172d7949048ea3b480ec5c727b206806 100644 (file)
@@ -21,6 +21,10 @@ require File.expand_path('../../test_helper', __FILE__)
 
 class SettingTest < ActiveSupport::TestCase
 
+  def setup
+    User.current = nil
+  end
+
   def teardown
     Setting.delete_all
     Setting.clear_cache
index c1d761370708c09c09b17c8738954a0ddcdc612a..077f6b6d890b23e6131a51ae8069456ec56becb2 100644 (file)
@@ -29,6 +29,10 @@ class TimeEntryActivityTest < ActiveSupport::TestCase
 
   include Redmine::I18n
 
+  def setup
+    User.current = nil
+  end
+
   def test_should_be_an_enumeration
     assert TimeEntryActivity.ancestors.include?(Enumeration)
   end
index 2f689189335d46874b1d46ffdd9aff96f9ea2dbf..f5533e4254acdd7e30f522b721d148798546f43b 100644 (file)
@@ -28,6 +28,10 @@ class TimeEntryQueryTest < ActiveSupport::TestCase
            :enabled_modules,
            :custom_fields, :custom_fields_trackers, :custom_fields_projects
 
+  def setup
+    User.current = nil
+  end
+
   def test_filter_values_without_project_should_be_arrays
     q = TimeEntryQuery.new
     assert_nil q.project
index a839a0810ea926b4c414a933943a5422f8d5c1ee..2c6c865c24ab330faa9057b027b5fad44cfb6e28 100644 (file)
@@ -20,6 +20,10 @@ require File.expand_path('../../test_helper', __FILE__)
 class TokenTest < ActiveSupport::TestCase
   fixtures :tokens, :users, :email_addresses
 
+  def setup
+    User.current = nil
+  end
+
   def test_create
     token = Token.new
     token.save
index 1e09743c3a8616848a1914dbe0bf1d2fd898f716..c1d02a56c850811cb771e242e7a5d969dffca1cd 100644 (file)
@@ -20,6 +20,10 @@ require File.expand_path('../../test_helper', __FILE__)
 class TrackerTest < ActiveSupport::TestCase
   fixtures :trackers, :workflows, :issue_statuses, :roles, :issues, :projects, :projects_trackers, :enabled_modules
 
+  def setup
+    User.current = nil
+  end
+
   def test_sorted_scope
     assert_equal Tracker.all.sort, Tracker.sorted.to_a
   end
index eb861fb8938d06500b268302c2a3405636bff601..b8765c2e21c839fe8bd7a1bbf6d07e3c3fe26c54 100644 (file)
@@ -20,6 +20,10 @@ require File.expand_path('../../test_helper', __FILE__)
 class UserPreferenceTest < ActiveSupport::TestCase
   fixtures :users, :user_preferences
 
+  def setup
+    User.current = nil
+  end
+
   def test_hide_mail_should_default_to_true
     preference = UserPreference.new
     assert_equal true, preference.hide_mail
index e3e52b33d94ef2da1fb82a04648ca3ff4b36d2f8..1a050c949b7e6ac7368c2a1418725c0e7481c915 100644 (file)
@@ -22,6 +22,10 @@ class VersionTest < ActiveSupport::TestCase
            :enumerations, :versions, :projects_trackers,
            :custom_fields, :custom_fields_trackers, :custom_fields_projects
 
+  def setup
+    User.current = nil
+  end
+
   def test_create
     v = Version.new(:project => Project.find(1), :name => '1.1',
                     :effective_date => '2011-03-25')
index c1184813b227f3479d75b65c1e575883941d6c0c..a5acbf9d163a38e5d3e5972067c84c1a993a888d 100644 (file)
@@ -25,6 +25,7 @@ class WatcherTest < ActiveSupport::TestCase
            :watchers
 
   def setup
+    User.current = nil
     @user = User.find(1)
     @issue = Issue.find(1)
   end
index 1b6dcf095d0e97a9132dcbacd5ab19beac770816..016fd916aeec0dadc4d2b5d4a6668fa04eb44854 100644 (file)
@@ -24,6 +24,7 @@ class WikiContentTest < ActiveSupport::TestCase
            :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
 
   def setup
+    User.current = nil
     @wiki = Wiki.find(1)
     @page = @wiki.pages.first
   end
index 9252e3a9c3a3b679923cd67b3f8c1d3b0b2522f7..4625f708a88936f81d958c67c24e32cd144a4b87 100644 (file)
@@ -21,6 +21,7 @@ class WikiContentVersionTest < ActiveSupport::TestCase
   fixtures :projects, :users, :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
 
   def setup
+    User.current = nil
   end
 
   def test_should_respond_to_attachments
index af08815ffc5ee2961db451f0d6c5d642e61785dd..3f41acff6ed1945fc2d259c62dfecc346256e760 100644 (file)
@@ -21,6 +21,7 @@ class WikiPageTest < ActiveSupport::TestCase
   fixtures :projects, :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
 
   def setup
+    User.current = nil
     @wiki = Wiki.find(1)
     @page = @wiki.pages.first
   end
index 2c9e1f70c885f06387f9a6ebf96d4201021f22d9..584a671e32ad471e87208c515198addd6076323c 100644 (file)
@@ -21,6 +21,7 @@ class WikiRedirectTest < ActiveSupport::TestCase
   fixtures :projects, :wikis, :wiki_pages
 
   def setup
+    User.current = nil
     @wiki = Wiki.find(1)
     @original = WikiPage.create(:wiki => @wiki, :title => 'Original title')
   end
index 47364459cf79047b59a7294601d23213306acd56..cd8f4ffd841ab7ef98f36ae13372299e3a3ad641 100644 (file)
@@ -22,6 +22,10 @@ require File.expand_path('../../test_helper', __FILE__)
 class WikiTest < ActiveSupport::TestCase
   fixtures :projects, :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
 
+  def setup
+    User.current = nil
+  end
+
   def test_create
     wiki = Wiki.new(:project => Project.find(3))
     assert !wiki.save
index 56d5ae622413c8e5268bf8dacd06ada75c41a040..a80288aba4e08657879d5452e1f6f699428a7f57 100644 (file)
@@ -20,6 +20,10 @@ require File.expand_path('../../test_helper', __FILE__)
 class WorkflowTest < ActiveSupport::TestCase
   fixtures :roles, :trackers, :issue_statuses
 
+  def setup
+    User.current = nil
+  end
+
   def test_copy
     WorkflowTransition.delete_all
     WorkflowTransition.create!(:role_id => 1, :tracker_id => 2, :old_status_id => 1, :new_status_id => 2)
index 1060ff4841e6bbcc95240e8be090cbc4f15433b9..62132c1cfd7a50f2651319fecf4a9006b6e6d9d6 100644 (file)
@@ -21,6 +21,7 @@ class WorkflowTransitionTest < ActiveSupport::TestCase
   fixtures :roles, :trackers, :issue_statuses
 
   def setup
+    User.current = nil
     WorkflowTransition.delete_all
   end