Actualiza a Redmine 3.4.13

This commit is contained in:
Manuel Cillero 2020-07-03 21:39:03 +02:00
parent 807ff3308d
commit ecddcaf1d3
224 changed files with 2222 additions and 1000 deletions

View 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

View file

@ -262,6 +262,7 @@ class AttachmentTest < ActiveSupport::TestCase
a = Attachment.new(:filename => "test.png", :description => "Cool image")
assert_equal "test.png (Cool image)", a.title
assert_equal "test.png", a.filename
end
def test_new_attachment_should_be_editable_by_author

View file

@ -26,6 +26,7 @@ class AttachmentTest < ActiveSupport::TestCase
self.use_transactional_fixtures = false
def setup
User.current = nil
set_tmp_attachments_directory
end

View file

@ -22,6 +22,7 @@ class AuthSourceLdapTest < ActiveSupport::TestCase
fixtures :auth_sources
def setup
User.current = nil
end
def test_initialize

View file

@ -25,6 +25,7 @@ class BoardTest < ActiveSupport::TestCase
include Redmine::I18n
def setup
User.current = nil
@project = Project.find(1)
end

View 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 = '*'

View file

@ -21,6 +21,7 @@ class CommentTest < ActiveSupport::TestCase
fixtures :users, :email_addresses, :news, :comments, :projects, :enabled_modules
def setup
User.current = nil
@jsmith = User.find(2)
@news = News.find(1)
end

View file

@ -206,6 +206,7 @@ class CustomFieldTest < ActiveSupport::TestCase
assert f.valid_field_value?('')
assert !f.valid_field_value?(' ')
assert f.valid_field_value?('123')
assert f.valid_field_value?(' 123 ')
assert f.valid_field_value?('+123')
assert f.valid_field_value?('-123')
assert !f.valid_field_value?('6abc')
@ -219,6 +220,7 @@ class CustomFieldTest < ActiveSupport::TestCase
assert f.valid_field_value?('')
assert !f.valid_field_value?(' ')
assert f.valid_field_value?('11.2')
assert f.valid_field_value?(' 11.2 ')
assert f.valid_field_value?('-6.250')
assert f.valid_field_value?('5')
assert !f.valid_field_value?('6abc')

View 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

View 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

View 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')

View 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

View 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

View 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 => [])

View 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

View 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

View file

@ -1328,7 +1328,6 @@ RAW
end
def test_avatar_enabled
tag_for_anonymous_re = %r{src="/images/anonymous.png(\?\d+)?"}
with_settings :gravatar_enabled => '1' do
assert avatar(User.find_by_mail('jsmith@somenet.foo')).include?(Digest::MD5.hexdigest('jsmith@somenet.foo'))
assert avatar('jsmith <jsmith@somenet.foo>').include?(Digest::MD5.hexdigest('jsmith@somenet.foo'))
@ -1340,10 +1339,13 @@ RAW
# The default class of the img tag should be gravatar
assert avatar('jsmith <jsmith@somenet.foo>').include?('class="gravatar"')
assert !avatar('jsmith <jsmith@somenet.foo>', :class => 'picture').include?('class="gravatar"')
assert_match tag_for_anonymous_re, avatar('jsmith')
assert_match tag_for_anonymous_re, avatar(nil)
assert_nil avatar('jsmith')
assert_nil avatar(nil)
# Avatar for anonymous user
assert_match tag_for_anonymous_re, avatar(User.anonymous)
assert_match %r{src="/images/anonymous.png(\?\d+)?"}, avatar(User.anonymous)
# No avatar for groups
assert_nil avatar(Group.first)
assert avatar(User.anonymous, :size => 24).include?('width="24" height="24"')
end
end

View 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

View 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)

View file

@ -35,6 +35,7 @@ class IssueImportTest < ActiveSupport::TestCase
include Redmine::I18n
def setup
User.current = nil
set_language_if_valid 'en'
end
@ -115,6 +116,15 @@ class IssueImportTest < ActiveSupport::TestCase
assert_equal 2, issues[2].parent_id
end
def test_import_utf8_with_bom
import = generate_import_with_mapping('import_issues_utf8_with_bom.csv')
import.settings.merge!('encoding' => 'UTF-8')
import.save
issues = new_records(Issue,3) { import.run }
assert_equal 3, issues.count
end
def test_backward_and_forward_reference_to_parent_should_work
import = generate_import('import_subtasks.csv')
import.settings = {
@ -188,4 +198,16 @@ class IssueImportTest < ActiveSupport::TestCase
import.run
assert !File.exists?(file_path)
end
def test_run_should_consider_project_shared_versions
system_version = Version.generate!(:project_id => 2, :sharing => 'system', :name => '2.1')
system_version.save!
import = generate_import_with_mapping
import.mapping.merge!('fixed_version' => '9')
import.save!
issues = new_records(Issue, 3) { import.run }
assert [nil, 3, system_version.id], issues.map(&:fixed_version_id)
end
end

View file

@ -28,6 +28,7 @@ class IssueNestedSetConcurrencyTest < ActiveSupport::TestCase
def setup
skip if sqlite? || mysql?
User.current = nil
CustomField.delete_all
end

View 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

View 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)

View 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

View 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

View 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)
@ -321,7 +325,7 @@ class IssueSubtaskingTest < ActiveSupport::TestCase
end
end
def test_parent_total_estimated_hours_should_be_sum_of_descendants
def test_parent_total_estimated_hours_should_be_sum_of_visible_descendants
parent = Issue.generate!
parent.generate_child!(:estimated_hours => nil)
assert_equal 0, parent.reload.total_estimated_hours
@ -329,6 +333,9 @@ class IssueSubtaskingTest < ActiveSupport::TestCase
assert_equal 5, parent.reload.total_estimated_hours
parent.generate_child!(:estimated_hours => 7)
assert_equal 12, parent.reload.total_estimated_hours
parent.generate_child!(:estimated_hours => 9, :is_private => true)
assert_equal 12, parent.reload.total_estimated_hours
end
def test_open_issue_with_closed_parent_should_not_validate

View file

@ -1375,6 +1375,63 @@ class IssueTest < ActiveSupport::TestCase
assert_not_nil copied_closed.closed_on
end
def test_copy_should_not_copy_locked_watchers
user = User.find(2)
user2 = User.find(3)
issue = Issue.find(8)
Watcher.create!(:user => user, :watchable => issue)
Watcher.create!(:user => user2, :watchable => issue)
user2.status = User::STATUS_LOCKED
user2.save!
issue = Issue.new.copy_from(8)
assert issue.save
assert issue.watched_by?(user)
assert !issue.watched_by?(user2)
end
def test_copy_should_clear_subtasks_target_version_if_locked_or_closed
version = Version.new(:project => Project.find(1), :name => '2.1',)
version.save!
parent = Issue.generate!
child1 = Issue.generate!(:parent_issue_id => parent.id, :subject => 'Child 1', :fixed_version_id => 3)
child2 = Issue.generate!(:parent_issue_id => parent.id, :subject => 'Child 2', :fixed_version_id => version.id)
version.status = 'locked'
version.save!
copy = parent.reload.copy
assert_difference 'Issue.count', 3 do
assert copy.save
end
assert_equal [3, nil], copy.children.map(&:fixed_version_id)
end
def test_copy_should_clear_subtasks_assignee_if_is_locked
user = User.find(2)
parent = Issue.generate!
child1 = Issue.generate!(:parent_issue_id => parent.id, :subject => 'Child 1', :assigned_to_id => 3)
child2 = Issue.generate!(:parent_issue_id => parent.id, :subject => 'Child 2', :assigned_to_id => user.id)
user.status = User::STATUS_LOCKED
user.save!
copy = parent.reload.copy
assert_difference 'Issue.count', 3 do
assert copy.save
end
assert_equal [3, nil], copy.children.map(&:assigned_to_id)
end
def test_should_not_call_after_project_change_on_creation
issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1,
:subject => 'Test', :author_id => 1)
@ -2089,6 +2146,32 @@ class IssueTest < ActiveSupport::TestCase
assert_equal Date.parse('2012-09-21'), issue2.due_date
end
def test_rescheduling_an_issue_to_a_different_due_date_should_add_journal_to_following_issue
with_settings :non_working_week_days => [] do
issue1 = Issue.generate!(:start_date => '2012-10-15', :due_date => '2012-10-17')
issue2 = Issue.generate!(:start_date => '2012-10-18', :due_date => '2012-10-20')
IssueRelation.create!(:issue_from => issue1, :issue_to => issue2,
:relation_type => IssueRelation::TYPE_PRECEDES)
assert_difference 'issue2.journals.count' do
issue1.reload
issue1.init_journal(User.find(3))
issue1.due_date = '2012-10-23'
issue1.save!
end
journal = issue2.journals.order(:id).last
start_date_detail = journal.details.find_by(:prop_key => 'start_date')
assert_equal '2012-10-18', start_date_detail.old_value
assert_equal '2012-10-24', start_date_detail.value
due_date_detail = journal.details.find_by(:prop_key => 'due_date')
assert_equal '2012-10-20', due_date_detail.old_value
assert_equal '2012-10-26', due_date_detail.value
end
end
def test_rescheduling_reschedule_following_issue_earlier_should_consider_other_preceding_issues
issue1 = Issue.generate!(:start_date => '2012-10-15', :due_date => '2012-10-17')
issue2 = Issue.generate!(:start_date => '2012-10-15', :due_date => '2012-10-17')

View file

@ -29,6 +29,10 @@ class IssueTransactionTest < ActiveSupport::TestCase
self.use_transactional_fixtures = false
def setup
User.current = nil
end
def test_invalid_move_to_another_project
lft1 = new_issue_lft
parent1 = Issue.generate!

View 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

View file

@ -21,8 +21,9 @@ class Redmine::CipheringTest < ActiveSupport::TestCase
def test_password_should_be_encrypted
Redmine::Configuration.with 'database_cipher_key' => 'secret' do
r = Repository::Subversion.create!(:password => 'foo', :url => 'file:///tmp', :identifier => 'svn')
assert_equal 'foo', r.password
plaintext_password = "THIS_IS_A_32_BYTES_LONG_PASSWORD"
r = Repository::Subversion.create!(:password => plaintext_password, :url => 'file:///tmp', :identifier => 'svn')
assert_equal plaintext_password, r.password
assert r.read_attribute(:password).match(/\Aaes-256-cbc:.+\Z/)
end
end

View file

@ -23,26 +23,26 @@ class Redmine::ConfigurationTest < ActiveSupport::TestCase
end
def test_empty
assert_kind_of Hash, load_conf('empty.yml', 'test')
assert_kind_of Hash, load_conf('empty.yml.example', 'test')
end
def test_default
assert_kind_of Hash, load_conf('default.yml', 'test')
assert_kind_of Hash, load_conf('default.yml.example', 'test')
assert_equal 'foo', @conf['somesetting']
end
def test_no_default
assert_kind_of Hash, load_conf('no_default.yml', 'test')
assert_kind_of Hash, load_conf('no_default.yml.example', 'test')
assert_equal 'foo', @conf['somesetting']
end
def test_overrides
assert_kind_of Hash, load_conf('overrides.yml', 'test')
assert_kind_of Hash, load_conf('overrides.yml.example', 'test')
assert_equal 'bar', @conf['somesetting']
end
def test_with
load_conf('default.yml', 'test')
load_conf('default.yml.example', 'test')
assert_equal 'foo', @conf['somesetting']
@conf.with 'somesetting' => 'bar' do
assert_equal 'bar', @conf['somesetting']

View file

@ -26,6 +26,7 @@ class AttachmentFormatVisibilityTest < ActionView::TestCase
:versions, :issues
def setup
User.current = nil
set_tmp_attachments_directory
end

View file

@ -23,6 +23,7 @@ class Redmine::BoolFieldFormatTest < ActionView::TestCase
include Redmine::I18n
def setup
User.current = nil
set_language_if_valid 'en'
end

View 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')

View file

@ -21,6 +21,7 @@ class Redmine::FieldFormatTest < ActionView::TestCase
include ApplicationHelper
def setup
User.current = nil
set_language_if_valid 'en'
end

View 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")

View file

@ -23,6 +23,7 @@ class Redmine::ListFieldFormatTest < ActionView::TestCase
include Redmine::I18n
def setup
User.current = nil
set_language_if_valid 'en'
end
@ -37,6 +38,16 @@ class Redmine::ListFieldFormatTest < ActionView::TestCase
assert group.valid?
end
def test_non_existing_value_should_be_invalid
field = GroupCustomField.create!(:name => 'List', :field_format => 'list', :possible_values => ['Foo', 'Bar'])
group = Group.new(:name => 'Group')
group.custom_field_values = {field.id => 'Baz'}
assert_not_include 'Baz', field.possible_custom_value_options(group.custom_value_for(field))
assert_equal false, group.valid?
assert_include "List #{::I18n.t('activerecord.errors.messages.inclusion')}", group.errors.full_messages.first
end
def test_edit_tag_should_have_id_and_name
field = IssueCustomField.new(:field_format => 'list', :possible_values => ['Foo', 'Bar'], :is_required => false)
value = CustomFieldValue.new(:custom_field => field, :customized => Issue.new)

View file

@ -1,31 +1,35 @@
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
# 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__)
require 'redmine/field_format'
class Redmine::NumericFieldFormatTest < ActionView::TestCase
include ApplicationHelper
def test_integer_field_with_url_pattern_should_format_as_link
field = IssueCustomField.new(:field_format => 'int', :url_pattern => 'http://foo/%value%')
custom_value = CustomValue.new(:custom_field => field, :customized => Issue.new, :value => "3")
assert_equal 3, field.format.formatted_custom_value(self, custom_value, false)
assert_equal '<a href="http://foo/3">3</a>', field.format.formatted_custom_value(self, custom_value, true)
end
end
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
# 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__)
require 'redmine/field_format'
class Redmine::NumericFieldFormatTest < ActionView::TestCase
include ApplicationHelper
def setup
User.current = nil
end
def test_integer_field_with_url_pattern_should_format_as_link
field = IssueCustomField.new(:field_format => 'int', :url_pattern => 'http://foo/%value%')
custom_value = CustomValue.new(:custom_field => field, :customized => Issue.new, :value => "3")
assert_equal 3, field.format.formatted_custom_value(self, custom_value, false)
assert_equal '<a href="http://foo/3">3</a>', field.format.formatted_custom_value(self, custom_value, true)
end
end

View file

@ -24,6 +24,10 @@ class Redmine::UserFieldFormatTest < ActionView::TestCase
:issue_statuses, :issue_categories, :issue_relations, :workflows,
:enumerations
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!
@ -45,6 +49,21 @@ class Redmine::UserFieldFormatTest < ActionView::TestCase
assert issue.valid?
end
def test_non_existing_values_should_be_invalid
field = IssueCustomField.create!(:name => 'Foo', :field_format => 'user', :is_for_all => true, :trackers => Tracker.all)
project = Project.generate!
user = User.generate!
User.add_to_project(user, project, Role.find_by_name('Developer'))
field.user_role = [Role.find_by_name('Manager').id]
field.save!
issue = Issue.new(:project_id => project.id, :tracker_id => 1, :custom_field_values => {field.id => user.id})
assert_not_include [user.name, user.id.to_s], field.possible_custom_value_options(issue.custom_value_for(field))
assert_equal false, issue.valid?
assert_include "Foo #{::I18n.t('activerecord.errors.messages.inclusion')}", issue.errors.full_messages.first
end
def test_possible_values_options_should_return_project_members
field = IssueCustomField.new(:field_format => 'user')
project = Project.find(1)

View file

@ -49,6 +49,20 @@ class Redmine::VersionFieldFormatTest < ActionView::TestCase
assert issue.valid?
end
def test_not_existing_values_should_be_invalid
field = IssueCustomField.create!(:name => 'Foo', :field_format => 'version', :is_for_all => true, :trackers => Tracker.all)
project = Project.generate!
version = Version.generate!(:project => project, :status => 'closed')
field.version_status = ["open"]
field.save!
issue = Issue.new(:project_id => project.id, :tracker_id => 1, :custom_field_values => {field.id => version.id})
assert_not_include [version.name, version.id.to_s], field.possible_custom_value_options(issue.custom_value_for(field))
assert_equal false, issue.valid?
assert_include "Foo #{::I18n.t('activerecord.errors.messages.inclusion')}", issue.errors.full_messages.first
end
def test_possible_values_options_should_return_project_versions
field = IssueCustomField.new(:field_format => 'version')
project = Project.find(1)

View file

@ -1,37 +1,37 @@
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
# 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 DiffTest < ActiveSupport::TestCase
def test_diff
diff = Redmine::Helpers::Diff.new("foo", "bar")
assert_not_nil diff
end
def test_dont_double_escape
# 3 cases to test in the before: first word, last word, everything inbetween
before = "<stuff> with html & special chars</danger>"
# all words in after are treated equal
after = "other stuff <script>alert('foo');</alert>"
computed_diff = Redmine::Helpers::Diff.new(before, after).to_html
expected_diff = '<span class="diff_in">&lt;stuff&gt; with html &amp; special chars&lt;/danger&gt;</span> <span class="diff_out">other stuff &lt;script&gt;alert(&#39;foo&#39;);&lt;/alert&gt;</span>'
assert_equal computed_diff, expected_diff
end
end
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
#
# 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 DiffTest < ActiveSupport::TestCase
def test_diff
diff = Redmine::Helpers::Diff.new("foo", "bar")
assert_not_nil diff
end
def test_dont_double_escape
# 3 cases to test in the before: first word, last word, everything inbetween
before = "<stuff> with html & special chars</danger>"
# all words in after are treated equal
after = "other stuff <script>alert('foo');</alert>"
computed_diff = Redmine::Helpers::Diff.new(before, after).to_html
expected_diff = '<span class="diff_in">&lt;stuff&gt; with html &amp; special chars&lt;/danger&gt;</span> <span class="diff_out">other stuff &lt;script&gt;alert(&#39;foo&#39;);&lt;/alert&gt;</span>'
assert_equal computed_diff, expected_diff
end
end

View file

@ -18,6 +18,15 @@
require File.expand_path('../../../../../../test_helper', __FILE__)
class Redmine::Views::Builders::JsonTest < ActiveSupport::TestCase
def test_nil_and_false
assert_json_output({'value' => nil}) do |b|
b.value nil
end
assert_json_output({'value' => false}) do |b|
b.value false
end
end
def test_hash
assert_json_output({'person' => {'name' => 'Ryan', 'age' => 32}}) do |b|

View file

@ -401,4 +401,9 @@ EXPECTED
assert_equal expected.gsub(%r{[\r\n\t]}, ''), textilizable(text).gsub(%r{[\r\n\t]}, '')
end
def test_macro_should_support_phrase_modifiers
text = "*{{hello_world}}*"
assert_match %r|\A<p><strong>Hello world!.*</strong></p>\z|, textilizable(text)
end
end

View file

@ -89,5 +89,70 @@ STR
assert_equal '<p>This is a <a href="/issues">link</a></p>', @formatter.new(text).to_html.strip
end
def test_markdown_should_not_require_surrounded_empty_line
text = <<-STR
This is a list:
* One
* Two
STR
assert_equal "<p>This is a list:</p>\n\n<ul>\n<li>One</li>\n<li>Two</li>\n</ul>", @formatter.new(text).to_html.strip
end
STR_WITH_PRE = [
# 0
"# Title
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sed libero.",
# 1
"## Heading 2
~~~ruby
def foo
end
>>>>>>> .merge-right.r17266
~~~
Morbi facilisis accumsan orci non pharetra.
```
Pre Content:
## Inside pre
<tag> inside pre block
Morbi facilisis accumsan orci non pharetra.
```",
# 2
"### Heading 3
Nulla nunc nisi, egestas in ornare vel, posuere ac libero."]
def test_get_section_should_ignore_pre_content
text = STR_WITH_PRE.join("\n\n")
assert_section_with_hash STR_WITH_PRE[1..2].join("\n\n"), text, 2
assert_section_with_hash STR_WITH_PRE[2], text, 3
end
def test_update_section_should_not_escape_pre_content_outside_section
text = STR_WITH_PRE.join("\n\n")
replacement = "New text"
assert_equal [STR_WITH_PRE[0..1], "New text"].flatten.join("\n\n"),
@formatter.new(text).update_section(3, replacement)
end
private
def assert_section_with_hash(expected, text, index)
result = @formatter.new(text).get_section(index)
assert_kind_of Array, result
assert_equal 2, result.size
assert_equal expected, result.first, "section content did not match"
assert_equal Digest::MD5.hexdigest(expected), result.last, "section hash did not match"
end
end
end

View file

@ -536,13 +536,24 @@ STR
def test_should_not_allow_arbitrary_class_attribute_on_offtags
%w(code pre kbd).each do |tag|
assert_html_output({"<#{tag} class=\"foo\">test</#{tag}>" => "<#{tag}>test</#{tag}>"}, false)
assert_html_output({"<#{tag} class='foo'>test</#{tag}>" => "<#{tag}>test</#{tag}>"}, false)
assert_html_output({"<#{tag} class=\"ruby foo\">test</#{tag}>" => "<#{tag}>test</#{tag}>"}, false)
assert_html_output({"<#{tag} class='ruby foo'>test</#{tag}>" => "<#{tag}>test</#{tag}>"}, false)
assert_html_output({"<#{tag} class=\"ruby \"foo\" bar\">test</#{tag}>" => "<#{tag}>test</#{tag}>"}, false)
end
assert_html_output({"<notextile class=\"foo\">test</notextile>" => "test"}, false)
assert_html_output({"<notextile class='foo'>test</notextile>" => "test"}, false)
assert_html_output({"<notextile class=\"ruby foo\">test</notextile>" => "test"}, false)
assert_html_output({"<notextile class='ruby foo'>test</notextile>" => "test"}, false)
assert_html_output({"<notextile class=\"ruby \"foo\" bar\">test</notextile>" => "test"}, false)
end
def test_should_allow_valid_language_class_attribute_on_code_tags
# language name is double-quoted
assert_html_output({"<code class=\"ruby\">test</code>" => "<code class=\"ruby syntaxhl\"><span class=\"CodeRay\">test</span></code>"}, false)
# language name is single-quoted
assert_html_output({"<code class='ruby'>test</code>" => "<code class=\"ruby syntaxhl\"><span class=\"CodeRay\">test</span></code>"}, false)
end
def test_should_not_allow_valid_language_class_attribute_on_non_code_offtags
@ -577,6 +588,28 @@ STR
}, false)
end
# TODO: Remove this test after migrating to RedCloth 4
def test_should_not_crash_with_special_input
assert_nothing_raised { to_html(" \f") }
assert_nothing_raised { to_html(" \v") }
end
def test_should_not_handle_as_preformatted_text_tags_that_starts_with_pre
text = <<-STR
<pree>
This is some text
</pree>
STR
expected = <<-EXPECTED
<p>&lt;pree&gt;<br />
This is some text<br />
&lt;/pree&gt;</p>
EXPECTED
assert_equal expected.gsub(%r{[\r\n\t]}, ''), to_html(text).gsub(%r{[\r\n\t]}, '')
end
private
def assert_html_output(to_test, expect_paragraph = true)

View file

@ -866,6 +866,21 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal 'Paella.jpg', detail.value
end
def test_update_issue_should_discard_all_changes_on_validation_failure
Issue.any_instance.stubs(:valid?).returns(false)
assert_no_difference 'Journal.count' do
assert_no_difference 'JournalDetail.count' do
assert_no_difference 'Attachment.count' do
assert_no_difference 'Issue.count' do
journal = submit_email('ticket_with_attachment.eml') do |raw|
raw.gsub! /^Subject: .*$/, 'Subject: Re: [Cookbook - Feature #2] (New) Add ingredients categories'
end
end
end
end
end
end
def test_update_issue_should_send_email_notification
journal = submit_email('ticket_reply.eml')
assert journal.is_a?(Journal)
@ -940,6 +955,17 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal Message.find(1), m.parent
end
def test_reply_to_a_locked_topic
# Lock the topic
topic = Message.find(2).parent
topic.update_attribute :locked, true
assert_no_difference('topic.replies_count') do
m = submit_email('message_reply_by_subject.eml')
assert_not_kind_of Message, m
end
end
def test_should_convert_tags_of_html_only_emails
with_settings :text_formatting => 'textile' do
issue = submit_email('ticket_html_only.eml', :issue => {:project => 'ecookbook'})
@ -1128,12 +1154,13 @@ class MailHandlerTest < ActiveSupport::TestCase
options = MailHandler.extract_options_from_env({
'tracker' => 'defect',
'project' => 'foo',
'unknown_user' => 'create'
'unknown_user' => 'create',
'no_notification' => '1'
})
assert_equal({
:issue => {:tracker => 'defect', :project => 'foo'},
:unknown_user => 'create'
:unknown_user => 'create', :no_notification => '1'
}, options)
end

View file

@ -713,6 +713,23 @@ class MailerTest < ActiveSupport::TestCase
end
end
def test_security_notification_with_overridden_originator_and_remote_ip
set_language_if_valid User.find(1).language
with_settings :emails_footer => "footer without link" do
User.current.remote_ip = '192.168.1.1'
assert Mailer.security_notification(User.find(1), message: :notice_account_password_updated, originator: User.find(2), remote_ip: '10.0.0.42').deliver
mail = last_email
assert_not_nil mail
assert_mail_body_match User.find(2).login, mail
assert_mail_body_match '10.0.0.42', mail
assert_mail_body_match I18n.t(:notice_account_password_updated), mail
assert_select_email do
assert_select "h1", false
assert_select "a", false
end
end
end
def test_security_notification_should_include_title
set_language_if_valid User.find(2).language
with_settings :emails_footer => "footer without link" do

View file

@ -35,6 +35,7 @@ class MemberTest < ActiveSupport::TestCase
include Redmine::I18n
def setup
User.current = nil
@jsmith = Member.find(1)
end

View 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

View file

@ -25,6 +25,7 @@ class NewsTest < ActiveSupport::TestCase
end
def setup
User.current = nil
end
def test_create_should_send_email_notification

View 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

View file

@ -21,6 +21,7 @@ class ProjectNestedSetConcurrencyTest < ActiveSupport::TestCase
self.use_transactional_fixtures = false
def setup
User.current = nil
CustomField.delete_all
end

View 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

View file

@ -876,6 +876,38 @@ class QueryTest < ActiveSupport::TestCase
User.current = nil
end
def test_filter_on_watched_issues_with_view_issue_watchers_permission
User.current = User.find(1)
User.current.admin = true
assert User.current.allowed_to?(:view_issue_watchers, Project.find(1))
Issue.find(1).add_watcher User.current
Issue.find(3).add_watcher User.find(3)
query = IssueQuery.new(:name => '_', :filters => { 'watcher_id' => {:operator => '=', :values => ['me', '3']}})
result = find_issues_with_query(query)
assert_includes result, Issue.find(1)
assert_includes result, Issue.find(3)
ensure
User.current.reload
User.current = nil
end
def test_filter_on_watched_issues_without_view_issue_watchers_permission
User.current = User.find(1)
User.current.admin = false
assert !User.current.allowed_to?(:view_issue_watchers, Project.find(1))
Issue.find(1).add_watcher User.current
Issue.find(3).add_watcher User.find(3)
query = IssueQuery.new(:name => '_', :filters => { 'watcher_id' => {:operator => '=', :values => ['me', '3']}})
result = find_issues_with_query(query)
assert_includes result, Issue.find(1)
assert_not_includes result, Issue.find(3)
ensure
User.current.reload
User.current = nil
end
def test_filter_on_custom_field_should_ignore_projects_with_field_disabled
field = IssueCustomField.generate!(:trackers => Tracker.all, :project_ids => [1, 3, 4], :is_for_all => false, :is_filter => true)
Issue.generate!(:project_id => 3, :tracker_id => 2, :custom_field_values => {field.id.to_s => 'Foo'})
@ -1458,6 +1490,12 @@ class QueryTest < ActiveSupport::TestCase
assert_equal [['id', 'desc']], q.sort_criteria
end
def test_sort_criteria_should_remove_blank_keys
q = IssueQuery.new
q.sort_criteria = [['priority', 'desc'], [nil, 'desc'], ['', 'asc'], ['project', 'asc']]
assert_equal [['priority', 'desc'], ['project', 'asc']], q.sort_criteria
end
def test_set_sort_criteria_with_hash
q = IssueQuery.new
q.sort_criteria = {'0' => ['priority', 'desc'], '2' => ['tracker']}
@ -1511,6 +1549,39 @@ class QueryTest < ActiveSupport::TestCase
assert_equal values.sort, values
end
def test_sort_by_total_for_estimated_hours
# Prepare issues
parent = issues(:issues_001)
child = issues(:issues_002)
private_child = issues(:issues_003)
other = issues(:issues_007)
User.current = users(:users_001)
parent.safe_attributes = {:estimated_hours => 1}
child.safe_attributes = {:estimated_hours => 2, :parent_issue_id => 1}
private_child.safe_attributes = {:estimated_hours => 4, :parent_issue_id => 1, :is_private => true}
other.safe_attributes = {:estimated_hours => 5}
[parent, child, private_child, other].each(&:save!)
q = IssueQuery.new(
:name => '_',
:filters => { 'issue_id' => {:operator => '=', :values => ['1,7']} },
:sort_criteria => [['total_estimated_hours', 'asc']]
)
# With private_child, `parent' is "bigger" than `other'
ids = q.issue_ids
assert_equal [7, 1], ids, "Private issue was not used to calculate sort order"
# Without the invisible private_child, `other' is "bigger" than `parent'
User.current = User.anonymous
ids = q.issue_ids
assert_equal [1, 7], ids, "Private issue was used to calculate sort order"
end
def test_set_totalable_names
q = IssueQuery.new
q.totalable_names = ['estimated_hours', :spent_hours, '']
@ -1790,6 +1861,11 @@ class QueryTest < ActiveSupport::TestCase
assert q.visible?(User.find(1))
assert IssueQuery.visible(User.find(1)).find_by_id(q.id)
# Should ignore archived project memberships
Project.find(1).archive
assert !q.visible?(User.find(3))
assert_nil IssueQuery.visible(User.find(3)).find_by_id(q.id)
end
def test_query_with_private_visibility_should_be_visible_to_owner
@ -1876,6 +1952,25 @@ class QueryTest < ActiveSupport::TestCase
end
end
def test_available_columns_should_not_include_total_estimated_hours_when_trackers_disabled_estimated_hours
Tracker.visible.each do |tracker|
tracker.core_fields = tracker.core_fields.reject{|field| field == 'estimated_hours'}
tracker.save!
end
query = IssueQuery.new
available_columns = query.available_columns.map(&:name)
assert_not_include :estimated_hours, available_columns
assert_not_include :total_estimated_hours, available_columns
tracker = Tracker.visible.first
tracker.core_fields = ['estimated_hours']
tracker.save!
query = IssueQuery.new
available_columns = query.available_columns.map(&:name)
assert_include :estimated_hours, available_columns
assert_include :total_estimated_hours, available_columns
end
def setup_member_of_group
Group.destroy_all # No fixtures
@user_in_group = User.generate!
@ -2119,4 +2214,19 @@ class QueryTest < ActiveSupport::TestCase
assert_equal ['1','2','3','4','5','6'], query.available_filters['status_id'][:values].map(&:second)
end
def test_as_params_should_serialize_query
query = IssueQuery.new(name: "_")
query.add_filter('subject', '!~', ['asdf'])
query.group_by = 'tracker'
query.totalable_names = %w(estimated_hours)
query.column_names = %w(id subject estimated_hours)
assert hsh = query.as_params
new_query = IssueQuery.build_from_params(hsh)
assert_equal query.filters, new_query.filters
assert_equal query.group_by, new_query.group_by
assert_equal query.column_names, new_query.column_names
assert_equal query.totalable_names, new_query.totalable_names
end
end

View 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,

View 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,

View 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(

View 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,

View 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,

View 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)

View file

@ -38,6 +38,7 @@ class RepositoryTest < ActiveSupport::TestCase
include Redmine::I18n
def setup
User.current = nil
@repository = Project.find(1).repository
end

View 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

View 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)

View 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

View 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

View file

@ -27,6 +27,10 @@ class TimeEntryQueryTest < ActiveSupport::TestCase
:groups_users,
:enabled_modules
def setup
User.current = nil
end
def test_filter_values_without_project_should_be_arrays
q = TimeEntryQuery.new
assert_nil q.project

View 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

View 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
def setup
User.current = nil
end
def test_sorted_scope
assert_equal Tracker.all.sort, Tracker.sorted.to_a
end

View 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

View file

@ -21,6 +21,10 @@ class VersionTest < ActiveSupport::TestCase
fixtures :projects, :users, :issues, :issue_statuses, :trackers,
:enumerations, :versions, :projects_trackers
def setup
User.current = nil
end
def test_create
v = Version.new(:project => Project.find(1), :name => '1.1',
:effective_date => '2011-03-25')
@ -277,6 +281,21 @@ class VersionTest < ActiveSupport::TestCase
assert_equal false, version.deletable?
end
def test_deletable_should_return_false_when_referenced_by_an_attachment
version = Version.generate!
Attachment.generate!(:container => version, :filename => 'test.txt')
assert_equal false, version.deletable?
end
def test_like_scope
version = Version.create!(:project => Project.find(1), :name => 'Version for like scope test')
assert_includes Version.like('VERSION FOR LIKE SCOPE TEST'), version
assert_includes Version.like('version for like scope test'), version
assert_includes Version.like('like scope'), version
end
private
def add_issue(version, attributes={})

View file

@ -25,6 +25,7 @@ class WatcherTest < ActiveSupport::TestCase
:watchers
def setup
User.current = nil
@user = User.find(1)
@issue = Issue.find(1)
end

View 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

View 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

View 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

View 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

View 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

View 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)

View file

@ -21,6 +21,7 @@ class WorkflowTransitionTest < ActiveSupport::TestCase
fixtures :roles, :trackers, :issue_statuses
def setup
User.current = nil
WorkflowTransition.delete_all
end