Skip to content

Commit

Permalink
Easy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
picman committed Jun 27, 2024
1 parent 09ace4d commit a2eeac3
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 273 deletions.
12 changes: 7 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

source 'https://rubygems.org' do
gem 'active_record_union'
gem 'ox' # Dav4Rack
gem 'rake' unless Dir.exist?(File.expand_path('../../redmine_dashboard', __FILE__))
gem 'uuidtools'
group :xapian do
gem 'xapian-ruby'
end
gem 'zip-zip' unless Dir.exist?(File.expand_path('../../vault', __FILE__))

# Redmine extensions
gem 'simple_enum' unless Dir.exist?(File.expand_path('../../easyproject', __FILE__))
unless Dir.exist?(File.expand_path('../../easyproject', __FILE__))
gem 'active_record_union'
gem 'simple_enum'
group :xapian do
gem 'xapian-ruby'
end
end
unless %w[easyproject easy_gantt custom_tables]
.any? { |plugin| Dir.exist?(File.expand_path("../../#{plugin}", __FILE__)) }
group :test do
Expand Down
2 changes: 1 addition & 1 deletion after_init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def dmsf_init
end

if Redmine::Plugin.installed?('easy_extensions')
ActiveSupport.on_load(:easyproject, yield: true) do
Rails.application.config.after_initialize do
dmsf_init

# Register panels for My page
Expand Down
37 changes: 18 additions & 19 deletions lib/redmine_dmsf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
require "#{File.dirname(__FILE__)}/redmine_dmsf/patches/pdf_patch"
require "#{File.dirname(__FILE__)}/redmine_dmsf/patches/access_control_patch"
require "#{File.dirname(__FILE__)}/redmine_dmsf/patches/search_patch"
require "#{File.dirname(__FILE__)}/redmine_dmsf/patches/search_controller_patch"
require "#{File.dirname(__FILE__)}/redmine_dmsf/patches/custom_field_patch"

# A workaround for obsolete 'alias_method' usage in RedmineUp's plugins
Expand All @@ -53,12 +52,6 @@
require "#{File.dirname(__FILE__)}/redmine_dmsf/patches/easy_crm_case_patch"
require "#{File.dirname(__FILE__)}/redmine_dmsf/patches/attachable_patch"
require "#{File.dirname(__FILE__)}/redmine_dmsf/patches/easy_crm_cases_controller_patch.rb"
require "#{File.dirname(__FILE__)}/redmine_dmsf/patches/xapian_easy_search_helper_patch.rb"
require "#{File.dirname(__FILE__)}/redmine_dmsf/patches/application_helper_patch.rb"

# Mappers
require "#{File.dirname(__FILE__)}/xapian_easy_search/dmsf_file_mapper.rb"
require "#{File.dirname(__FILE__)}/xapian_easy_search/dmsf_folder_mapper.rb"
end

# Load up classes that make up our WebDAV solution ontop of Dav4rack
Expand All @@ -78,18 +71,24 @@
require "#{File.dirname(__FILE__)}/redmine_dmsf/errors/dmsf_zip_max_files_error"

# Hooks
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/controllers/account_controller_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/controllers/search_controller_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/controllers/issues_controller_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/view_projects_form_hook"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/base_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/custom_field_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/issue_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/my_account_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/search_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/helpers/issues_helper_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/helpers/search_helper_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/helpers/project_helper_hooks"
def require_hooks
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/controllers/issues_controller_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/view_projects_form_hook"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/base_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/custom_field_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/issue_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/my_account_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/views/search_view_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/helpers/issues_helper_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/helpers/search_helper_hooks"
require "#{File.dirname(__FILE__)}/redmine_dmsf/hooks/helpers/project_helper_hooks"
end

if defined?(EasyExtensions)
Rails.application.config.to_prepare { require_hooks }
else
require_hooks
end

# Macros
require "#{File.dirname(__FILE__)}/redmine_dmsf/macros"
Expand Down
42 changes: 0 additions & 42 deletions lib/redmine_dmsf/patches/application_helper_patch.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/redmine_dmsf/patches/role_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def self.included(base)
def remove_dmsf_references
return unless id

substitute = User.anonymous
substitute = Role.anonymous
DmsfFolderPermission.where(object_id: id, object_type: 'Role').update_all object_id: substitute.id
end
end
Expand Down
44 changes: 0 additions & 44 deletions lib/redmine_dmsf/patches/search_controller_patch.rb

This file was deleted.

42 changes: 0 additions & 42 deletions lib/redmine_dmsf/patches/xapian_easy_search_helper_patch.rb

This file was deleted.

30 changes: 0 additions & 30 deletions lib/xapian_easy_search/base_mapper.rb

This file was deleted.

49 changes: 0 additions & 49 deletions lib/xapian_easy_search/dmsf_file_mapper.rb

This file was deleted.

40 changes: 0 additions & 40 deletions lib/xapian_easy_search/dmsf_folder_mapper.rb

This file was deleted.

0 comments on commit a2eeac3

Please sign in to comment.