diff options
Diffstat (limited to 'test/extra/redmine_pm')
-rw-r--r-- | test/extra/redmine_pm/repository_git_test_pm.rb | 2 | ||||
-rw-r--r-- | test/extra/redmine_pm/repository_subversion_test_pm.rb | 6 | ||||
-rw-r--r-- | test/extra/redmine_pm/test_case.rb | 22 |
3 files changed, 15 insertions, 15 deletions
diff --git a/test/extra/redmine_pm/repository_git_test_pm.rb b/test/extra/redmine_pm/repository_git_test_pm.rb index 4f9edf725..f7e165dc4 100644 --- a/test/extra/redmine_pm/repository_git_test_pm.rb +++ b/test/extra/redmine_pm/repository_git_test_pm.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false # Redmine - project management software -# Copyright (C) 2006-2023 Jean-Philippe Lang +# Copyright (C) 2006- 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 diff --git a/test/extra/redmine_pm/repository_subversion_test_pm.rb b/test/extra/redmine_pm/repository_subversion_test_pm.rb index 8970beba0..a529d697c 100644 --- a/test/extra/redmine_pm/repository_subversion_test_pm.rb +++ b/test/extra/redmine_pm/repository_subversion_test_pm.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false # Redmine - project management software -# Copyright (C) 2006-2023 Jean-Philippe Lang +# Copyright (C) 2006- 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 @@ -256,13 +256,13 @@ class RedminePmTest::RepositorySubversionTest < RedminePmTest::TestCase ldap_user = User.new(:mail => 'example1@redmine.org', :firstname => 'LDAP', :lastname => 'user', :auth_source_id => 1) ldap_user.login = 'example1' ldap_user.save! - + with_settings :login_required => '1' do with_credentials "example1", "123456" do assert_success "ls", svn_url end end - + with_settings :login_required => '1' do with_credentials "example1", "wrong" do assert_failure "ls", svn_url diff --git a/test/extra/redmine_pm/test_case.rb b/test/extra/redmine_pm/test_case.rb index cc731c9df..d6d07e085 100644 --- a/test/extra/redmine_pm/test_case.rb +++ b/test/extra/redmine_pm/test_case.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false # Redmine - project management software -# Copyright (C) 2006-2023 Jean-Philippe Lang +# Copyright (C) 2006- 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 @@ -22,16 +22,16 @@ require File.expand_path('../../../test_helper', __FILE__) module RedminePmTest class TestCase < ActiveSupport::TestCase attr_reader :command, :response, :status, :username, :password - + # Cannot use transactional fixtures here: database # will be accessed from Redmine.pm with its own connection self.use_transactional_tests = false - + def test_dummy end - + protected - + def assert_response(expected, msg=nil) case expected when :success @@ -44,17 +44,17 @@ module RedminePmTest assert_equal expected, status, msg end end - + def assert_success(*args) execute *args assert_response :success end - + def assert_failure(*args) execute *args assert_response :failure end - + def with_credentials(username, password) old_username, old_password = @username, @password @username, @password = username, password @@ -62,7 +62,7 @@ module RedminePmTest ensure @username, @password = old_username, old_password end - + def execute(*args) @command = args.join(' ') @status = nil @@ -72,11 +72,11 @@ module RedminePmTest end @status = $?.exitstatus end - + def formatted_response "#{'='*40}\n#{response}#{'='*40}" end - + def random_filename Redmine::Utils.random_hex(16) end |