summaryrefslogtreecommitdiffstats
path: root/test/unit/issue_import_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-05-09 07:40:06 +0000
committerGo MAEDA <maeda@farend.jp>2019-05-09 07:40:06 +0000
commitb540046ed7084ba50f5ca280f3ffae0751af8142 (patch)
tree4bc946090d4940a219e84f70ca72c5655de5be42 /test/unit/issue_import_test.rb
parentbcc60805c97104f44a37b92321d7aa1e5c51b622 (diff)
downloadredmine-b540046ed7084ba50f5ca280f3ffae0751af8142.tar.gz
redmine-b540046ed7084ba50f5ca280f3ffae0751af8142.zip
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
Diffstat (limited to 'test/unit/issue_import_test.rb')
-rw-r--r--test/unit/issue_import_test.rb6
1 files changed, 6 insertions, 0 deletions
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')