:wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
def setup
+ User.current = nil
@project = Project.find(1)
end
self.use_transactional_tests = false
def setup
+ User.current = nil
set_tmp_attachments_directory
end
fixtures :auth_sources
def setup
+ User.current = nil
end
def test_initialize
include Redmine::I18n
def setup
+ User.current = nil
@project = Project.find(1)
end
: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 = '*'
:user_preferences, :roles, :members, :member_roles
def setup
+ User.current = nil
@jsmith = User.find(2)
@news = News.find(1)
end
fixtures :custom_fields, :projects, :members, :users, :member_roles, :trackers, :issues
def setup
+ User.current = nil
@field = IssueCustomField.create!(:name => 'Tester', :field_format => 'user')
end
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
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')
include Redmine::I18n
fixtures :roles
+ def setup
+ User.current = nil
+ end
+
def test_no_data
assert !Redmine::DefaultData::Loader::no_data?
clear_data
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
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 => [])
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
include Redmine::I18n
+ def setup
+ User.current = nil
+ end
+
def test_create
g = Group.new(:name => 'New group')
assert g.save
fixtures :issue_categories, :issues, :users, :groups_users
def setup
+ User.current = nil
@category = IssueCategory.find(1)
end
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)
include Redmine::I18n
def setup
+ User.current = nil
set_language_if_valid 'en'
end
def setup
skip if sqlite? || mysql?
+ User.current = nil
CustomField.delete_all
end
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
include Redmine::I18n
+ def setup
+ User.current = nil
+ end
+
def test_create
from = Issue.find(1)
to = Issue.find(2)
: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
: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
:enabled_modules,
:workflows
+ def setup
+ User.current = nil
+ end
+
def test_leaf_planning_fields_should_be_editable
issue = Issue.generate!
user = User.find(1)
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!
:users, :email_addresses, :roles
def setup
+ User.current = nil
ActionMailer::Base.deliveries.clear
@journal = Journal.find 1
end
:versions, :issues
def setup
+ User.current = nil
set_tmp_attachments_directory
end
include Redmine::I18n
def setup
+ User.current = nil
set_language_if_valid 'en'
end
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')
include ApplicationHelper
def setup
+ User.current = nil
set_language_if_valid 'en'
end
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")
include Redmine::I18n
def setup
+ User.current = nil
set_language_if_valid 'en'
end
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
: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!
include Redmine::I18n
def setup
+ User.current = nil
@jsmith = Member.find(1)
end
:users, :watchers, :enabled_modules
def setup
+ User.current = nil
@board = Board.find(1)
@user = User.find(1)
end
end
def setup
+ User.current = nil
end
def test_create_should_send_email_notification
: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
self.use_transactional_tests = false
def setup
+ User.current = nil
CustomField.delete_all
end
class ProjectNestedSetTest < ActiveSupport::TestCase
def setup
+ User.current = nil
Project.delete_all
Tracker.delete_all
EnabledModule.delete_all
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,
CHANGESETS_NUM = 7
def setup
+ User.current = nil
@project = Project.find(3)
@repository = Repository::Cvs.create(:project => @project,
:root_url => REPOSITORY_PATH,
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(
JRUBY_SKIP_STR = "TODO: This test fails in JRuby"
def setup
+ User.current = nil
@project = Project.find(3)
@repository = Repository::Git.create(
:project => @project,
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,
NUM_REV = 11
def setup
+ User.current = nil
@project = Project.find(3)
@repository = Repository::Subversion.create(:project => @project,
:url => self.class.subversion_repository_url)
include Redmine::I18n
def setup
+ User.current = nil
@repository = Project.find(1).repository
end
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
:changesets
def setup
+ User.current = nil
@project = Project.find(1)
@issue_keyword = '%unable to print recipes%'
@issue = Issue.find(1)
class SettingTest < ActiveSupport::TestCase
+ def setup
+ User.current = nil
+ end
+
def teardown
Setting.delete_all
Setting.clear_cache
include Redmine::I18n
+ def setup
+ User.current = nil
+ end
+
def test_should_be_an_enumeration
assert TimeEntryActivity.ancestors.include?(Enumeration)
end
: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
class TokenTest < ActiveSupport::TestCase
fixtures :tokens, :users, :email_addresses
+ def setup
+ User.current = nil
+ end
+
def test_create
token = Token.new
token.save
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
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
: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')
:watchers
def setup
+ User.current = nil
@user = User.find(1)
@issue = Issue.find(1)
end
:wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
def setup
+ User.current = nil
@wiki = Wiki.find(1)
@page = @wiki.pages.first
end
fixtures :projects, :users, :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
def setup
+ User.current = nil
end
def test_should_respond_to_attachments
fixtures :projects, :wikis, :wiki_pages, :wiki_contents, :wiki_content_versions
def setup
+ User.current = nil
@wiki = Wiki.find(1)
@page = @wiki.pages.first
end
fixtures :projects, :wikis, :wiki_pages
def setup
+ User.current = nil
@wiki = Wiki.find(1)
@original = WikiPage.create(:wiki => @wiki, :title => 'Original title')
end
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
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)
fixtures :roles, :trackers, :issue_statuses
def setup
+ User.current = nil
WorkflowTransition.delete_all
end