##// END OF EJS Templates
Replace Date.today with User.current.today (#22320)....
Replace Date.today with User.current.today (#22320). Depending on the offset between a user's configured timezone and the server timezone, Date.today may be more or less often wrong from the user's perspective, leading to things like issues marked as overdue too early or too late, or yesterday / tomorrow being displayed / selected where 'today' is intended. A test case illustrating the problem with Issue#overdue? is included Patch by Jens Kraemer. git-svn-id: http://svn.redmine.org/redmine/trunk@15379 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r14856:cda9c63d9c21
r14997:ed50d42210ea
Show More
issue_transaction_test.rb
52 lines | 2.3 KiB | text/x-ruby | RubyLexer
/ test / unit / issue_transaction_test.rb
Jean-Philippe Lang
Isolate the test that actually require non transactional fixtures....
r10399 # Redmine - project management software
Jean-Philippe Lang
Updates copyright for 2016....
r14856 # Copyright (C) 2006-2016 Jean-Philippe Lang
Jean-Philippe Lang
Isolate the test that actually require non transactional fixtures....
r10399 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require File.expand_path('../../test_helper', __FILE__)
class IssueTransactionTest < ActiveSupport::TestCase
fixtures :projects, :users, :members, :member_roles, :roles,
:trackers, :projects_trackers,
:versions,
:issue_statuses, :issue_categories, :issue_relations, :workflows,
:enumerations,
:issues,
:custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values,
:time_entries
self.use_transactional_fixtures = false
def test_invalid_move_to_another_project
Toshi MARUYAMA
adjust tests to awesome_nested_set new node lft and rgt value behavior change...
r12418 lft1 = new_issue_lft
Jean-Philippe Lang
Removed issue_create! helper in favour of Issue.generate!...
r10402 parent1 = Issue.generate!
child = Issue.generate!(:parent_issue_id => parent1.id)
grandchild = Issue.generate!(:parent_issue_id => child.id, :tracker_id => 2)
Jean-Philippe Lang
Isolate the test that actually require non transactional fixtures....
r10399 Project.find(2).tracker_ids = [1]
parent1.reload
Toshi MARUYAMA
adjust tests to awesome_nested_set new node lft and rgt value behavior change...
r12418 assert_equal [1, parent1.id, lft1, lft1 + 5], [parent1.project_id, parent1.root_id, parent1.lft, parent1.rgt]
Jean-Philippe Lang
Isolate the test that actually require non transactional fixtures....
r10399 # child can not be moved to Project 2 because its child is on a disabled tracker
child = Issue.find(child.id)
child.project = Project.find(2)
assert !child.save
child.reload
grandchild.reload
parent1.reload
# no change
Toshi MARUYAMA
adjust tests to awesome_nested_set new node lft and rgt value behavior change...
r12418 assert_equal [1, parent1.id, lft1, lft1 + 5], [parent1.project_id, parent1.root_id, parent1.lft, parent1.rgt]
assert_equal [1, parent1.id, lft1 + 1, lft1 + 4], [child.project_id, child.root_id, child.lft, child.rgt]
assert_equal [1, parent1.id, lft1 + 2, lft1 + 3], [grandchild.project_id, grandchild.root_id, grandchild.lft, grandchild.rgt]
Jean-Philippe Lang
Isolate the test that actually require non transactional fixtures....
r10399 end
end