diff options
author | Go MAEDA <maeda@farend.jp> | 2019-09-05 05:58:15 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-09-05 05:58:15 +0000 |
commit | 2e71eda8c1c626c1ab1d3e340fa594992b71a117 (patch) | |
tree | a482fe7328af1ad9bfa07d57d113ab9a105e5d4a /test/unit/lib | |
parent | 481a575f5a7f204ea40e1cb95ac2859363721964 (diff) | |
download | redmine-2e71eda8c1c626c1ab1d3e340fa594992b71a117.tar.gz redmine-2e71eda8c1c626c1ab1d3e340fa594992b71a117.zip |
Merged r17761 from trunk to 4.0-stable (#32022).
git-svn-id: http://svn.redmine.org/redmine/branches/4.0-stable@18432 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/lib')
8 files changed, 18 insertions, 0 deletions
diff --git a/test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb b/test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb index 4ce4062bb..8d883f95a 100644 --- a/test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb +++ b/test/unit/lib/redmine/field_format/attachment_format_visibility_test.rb @@ -26,6 +26,7 @@ class AttachmentFormatVisibilityTest < ActionView::TestCase :versions, :issues def setup + User.current = nil set_tmp_attachments_directory end diff --git a/test/unit/lib/redmine/field_format/bool_format_test.rb b/test/unit/lib/redmine/field_format/bool_format_test.rb index 9041c81e8..2458de1ed 100644 --- a/test/unit/lib/redmine/field_format/bool_format_test.rb +++ b/test/unit/lib/redmine/field_format/bool_format_test.rb @@ -23,6 +23,7 @@ class Redmine::BoolFieldFormatTest < ActionView::TestCase include Redmine::I18n def setup + User.current = nil set_language_if_valid 'en' end diff --git a/test/unit/lib/redmine/field_format/enumeration_format_test.rb b/test/unit/lib/redmine/field_format/enumeration_format_test.rb index bc9a498d1..9b977b221 100644 --- a/test/unit/lib/redmine/field_format/enumeration_format_test.rb +++ b/test/unit/lib/redmine/field_format/enumeration_format_test.rb @@ -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') diff --git a/test/unit/lib/redmine/field_format/field_format_test.rb b/test/unit/lib/redmine/field_format/field_format_test.rb index f06638944..7d98f2585 100644 --- a/test/unit/lib/redmine/field_format/field_format_test.rb +++ b/test/unit/lib/redmine/field_format/field_format_test.rb @@ -21,6 +21,7 @@ class Redmine::FieldFormatTest < ActionView::TestCase include ApplicationHelper def setup + User.current = nil set_language_if_valid 'en' end diff --git a/test/unit/lib/redmine/field_format/link_format_test.rb b/test/unit/lib/redmine/field_format/link_format_test.rb index d5758be17..aa7e8de52 100644 --- a/test/unit/lib/redmine/field_format/link_format_test.rb +++ b/test/unit/lib/redmine/field_format/link_format_test.rb @@ -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") diff --git a/test/unit/lib/redmine/field_format/list_format_test.rb b/test/unit/lib/redmine/field_format/list_format_test.rb index 8a19e3527..06a7fbda4 100644 --- a/test/unit/lib/redmine/field_format/list_format_test.rb +++ b/test/unit/lib/redmine/field_format/list_format_test.rb @@ -23,6 +23,7 @@ class Redmine::ListFieldFormatTest < ActionView::TestCase include Redmine::I18n def setup + User.current = nil set_language_if_valid 'en' end diff --git a/test/unit/lib/redmine/field_format/numeric_format_test.rb b/test/unit/lib/redmine/field_format/numeric_format_test.rb index e6572d8c6..72e2148d5 100644 --- a/test/unit/lib/redmine/field_format/numeric_format_test.rb +++ b/test/unit/lib/redmine/field_format/numeric_format_test.rb @@ -21,6 +21,10 @@ 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")
diff --git a/test/unit/lib/redmine/field_format/user_field_format_test.rb b/test/unit/lib/redmine/field_format/user_field_format_test.rb index 2612bb475..e545c6d4f 100644 --- a/test/unit/lib/redmine/field_format/user_field_format_test.rb +++ b/test/unit/lib/redmine/field_format/user_field_format_test.rb @@ -25,6 +25,10 @@ class Redmine::UserFieldFormatTest < ActionView::TestCase :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! |