From b540046ed7084ba50f5ca280f3ffae0751af8142 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 9 May 2019 07:40:06 +0000 Subject: Generalize issues imports (#28234). Extend import controller to support arbitrary imports based on Import subclasses. This way, we may add other kinds of imports, by providing some views and a custom import class. This may also be done from within plugins. Patch by Gregor Schmidt. git-svn-id: http://svn.redmine.org/redmine/trunk@18145 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/issue_import_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/unit/issue_import_test.rb') diff --git a/test/unit/issue_import_test.rb b/test/unit/issue_import_test.rb index 9c4eafba1..4def8b120 100644 --- a/test/unit/issue_import_test.rb +++ b/test/unit/issue_import_test.rb @@ -41,6 +41,12 @@ class IssueImportTest < ActiveSupport::TestCase set_language_if_valid 'en' end + def test_authorized + assert IssueImport.authorized?(User.find(1)) # admins + assert IssueImport.authorized?(User.find(2)) # has import_issues permission + assert !IssueImport.authorized?(User.find(3)) # does not have permission + end + def test_create_versions_should_create_missing_versions import = generate_import_with_mapping import.mapping.merge!('fixed_version' => '9', 'create_versions' => '1') -- cgit v1.2.3