summaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-24 16:26:50 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-24 16:26:50 +0000
commit17a5f26e5027c0efc4dae45e379fe2d9ce76490e (patch)
tree223cac10d8c1e178e9a5b4523ffdc4c79a4fbc39 /test/test_helper.rb
parent0829ac775d9462ea1ff52f68cc78d2c6e57b68ae (diff)
downloadredmine-17a5f26e5027c0efc4dae45e379fe2d9ce76490e.tar.gz
redmine-17a5f26e5027c0efc4dae45e379fe2d9ce76490e.zip
adjust tests to awesome_nested_set new node lft and rgt value behavior change
git-svn-id: http://svn.redmine.org/redmine/trunk@12693 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 725b1f596..6973d5fb4 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -24,6 +24,8 @@ require Rails.root.join('test', 'mocks', 'open_id_authentication_mock.rb').to_s
require File.expand_path(File.dirname(__FILE__) + '/object_helpers')
include ObjectHelpers
+require 'awesome_nested_set/version'
+
class ActiveSupport::TestCase
include ActionDispatch::TestProcess
@@ -197,6 +199,16 @@ class ActiveSupport::TestCase
def mail_body(mail)
mail.parts.first.body.encoded
end
+
+ # awesome_nested_set new node lft and rgt value changed this refactor revision.
+ # https://github.com/collectiveidea/awesome_nested_set/commit/199fca9bb938e40200cd90714dc69247ef017c61
+ # The reason of behavior change is "self.class.base_class.unscoped" added this line.
+ # https://github.com/collectiveidea/awesome_nested_set/commit/199fca9bb9#diff-f61b59a5e6319024e211b0ffdd0e4ef1R273
+ # It seems correct behavior because of this line comment.
+ # https://github.com/collectiveidea/awesome_nested_set/blame/199fca9bb9/lib/awesome_nested_set/model.rb#L278
+ def new_issue_lft
+ ::AwesomeNestedSet::VERSION > "2.1.6" ? Issue.maximum(:rgt) + 1 : 1
+ end
end
module Redmine