]> source.dussan.org Git - redmine.git/commitdiff
Fix that the following tests fail randomly due to uninitialized User.current (#29853):
authorGo MAEDA <maeda@farend.jp>
Sat, 3 Nov 2018 07:15:00 +0000 (07:15 +0000)
committerGo MAEDA <maeda@farend.jp>
Sat, 3 Nov 2018 07:15:00 +0000 (07:15 +0000)
* AttachmentsVisibilityTest#test_attachment_should_be_visible
*
Redmine::AttachmentFieldFormatTest#test_should_accept_a_hash_with_upload_on_create
*
Redmine::AttachmentFieldFormatTest#test_should_replace_attachment_on_update

Patch by Gilad Shanan.

git-svn-id: http://svn.redmine.org/redmine/trunk@17616 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/attachments_visibility_test.rb
test/integration/api_test/authentication_test.rb
test/integration/lib/redmine/field_format/attachment_format_test.rb

index 96230e8b2b5a1ae7dc397edf9f52cf7d22b629a4..2f9197e6bd41ef60062d548fbf2cb0eab7fc7fc8 100644 (file)
@@ -26,6 +26,7 @@ class AttachmentsVisibilityTest < Redmine::ControllerTest
            :issues, :trackers, :versions
 
   def setup
+    User.current = nil
     set_tmp_attachments_directory
 
     @field = IssueCustomField.generate!(:field_format => 'attachment', :visible => true)
index 678ee98f567e2d8336d753a5e3e7d3c1ca41be91..f1c2e9e79229fad33b1c58ad4c76659ae6b4f6ab 100644 (file)
@@ -20,6 +20,10 @@ require File.expand_path('../../../test_helper', __FILE__)
 class Redmine::ApiTest::AuthenticationTest < Redmine::ApiTest::Base
   fixtures :users
 
+  def teardown
+    User.current = nil
+  end
+
   def test_api_should_deny_without_credentials
     get '/users/current.xml'
     assert_response 401
index 958b257698cde00d4f5b75be1b62455f6e5c87b8..a01149d01cd7ea0a05f13567b73e9bdb00b57df3 100644 (file)
@@ -35,6 +35,7 @@ class AttachmentFieldFormatTest < Redmine::IntegrationTest
            :attachments
 
   def setup
+    User.current = nil
     set_tmp_attachments_directory
     @field = IssueCustomField.generate!(:name => "File", :field_format => "attachment")
     log_user "jsmith", "jsmith"