Skip to content

Commit 3c85b92

Browse files
committed
Update CI config: add Redmine 6 and drop support of Redmine 4
1 parent f6d11c7 commit 3c85b92

File tree

10 files changed

+22
-18
lines changed

10 files changed

+22
-18
lines changed

.github/workflows/5_1_2.yml renamed to .github/workflows/5_1_5.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Tests 5.1.2
1+
name: Tests 5.1.5
22

33
env:
44
PLUGIN_NAME: redmine_extended_workflows
5-
REDMINE_VERSION: 5.1.2
5+
REDMINE_VERSION: 5.1.5
66
RAILS_ENV: test
77

88
on:

.github/workflows/4_2_11.yml renamed to .github/workflows/6_0_2.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Tests 4.2.11
1+
name: Tests 6.0.2
22

33
env:
44
PLUGIN_NAME: redmine_extended_workflows
5-
REDMINE_VERSION: 4.2.11
5+
REDMINE_VERSION: 6.0.2
66
RAILS_ENV: test
77

88
on:
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
ruby: ['2.7']
19+
ruby: ['3.3']
2020
db: ['postgres']
2121
fail-fast: false
2222

@@ -89,8 +89,6 @@ jobs:
8989
- name: Prepare Redmine source
9090
working-directory: redmine
9191
run: |
92-
# TODO Remove the following line when https://www.redmine.org/issues/40551 is fixed
93-
sed -i -e 's/.*mocha.*/ gem "mocha", "2.1.0"/' Gemfile # Fix core tests not compatible with Mocha 2.2.0
9492
sed -i '/rubocop/d' Gemfile
9593
rm -f .rubocop*
9694
cp plugins/redmine_base_rspec/spec/support/database-${{ matrix.db }}.yml config/database.yml

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
ruby: ['3.2']
19+
ruby: ['3.3']
2020
db: ['postgres']
2121
fail-fast: false
2222

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ Test status
2424

2525
| Plugin branch | Redmine Version | Test Status |
2626
|---------------|-----------------|-------------------|
27-
| master | 5.1.2 | [![5.1.2][1]][5] |
28-
| master | 4.2.11 | [![4.2.11][2]][5] |
27+
| master | 5.1.5 | [![5.1.5][1]][5] |
28+
| master | 6.0.2 | [![6.0.2][2]][5] |
2929
| master | master | [![master][4]][5] |
3030

31-
[1]: https://github.com/nanego/redmine_extended_workflows/actions/workflows/5_1_2.yml/badge.svg
32-
[2]: https://github.com/nanego/redmine_extended_workflows/actions/workflows/4_2_11.yml/badge.svg
31+
[1]: https://github.com/nanego/redmine_extended_workflows/actions/workflows/5_1_5.yml/badge.svg
32+
[2]: https://github.com/nanego/redmine_extended_workflows/actions/workflows/6_0_2.yml/badge.svg
3333
[4]: https://github.com/nanego/redmine_extended_workflows/actions/workflows/master.yml/badge.svg
3434
[5]: https://github.com/nanego/redmine_extended_workflows/actions
3535

app/models/workflow_project.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class WorkflowProject < ActiveRecord::Base
1+
class WorkflowProject < ApplicationRecord
22

33
belongs_to :role
44
validates_presence_of :role

assets/javascripts/redmine_extended_workflows.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ function selectOptionForAll(parent_selector, element_selector, option) {
22
$(parent_selector).find(`select[name^=${element_selector}]`).each(function() {
33
$(this).val(option);
44
})
5-
}
5+
}

init.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@
88
url 'https://github.com/nanego/redmine_extended_workflows'
99
requires_redmine_plugin :redmine_base_rspec, :version_or_higher => '0.0.3' if Rails.env.test?
1010
end
11+
12+
# Support for Redmine 5
13+
if Redmine::VERSION::MAJOR < 6
14+
class ApplicationRecord < ActiveRecord::Base
15+
self.abstract_class = true
16+
end
17+
end

lib/redmine_extended_workflows/models/project_patch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ def self.get_read_only_attribute_for_roles(user_roles)
3131
end
3232
Project.send(:include, RedmineExtendedWorkflows::Models::ProjectPatch)
3333

34-
class Project < ActiveRecord::Base
34+
class Project
3535
CORE_FIELDS = %w(name description is_public parent_id inherit_members homepage).freeze
3636
end

spec/controllers/projects_controller_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
include Redmine::I18n
1010

1111
before do
12-
@controller = ProjectsController.new
13-
@request = ActionDispatch::TestRequest.create
14-
@response = ActionDispatch::TestResponse.new
1512
User.current = nil
13+
@request.session = ActionController::TestSession.new
1614
@request.session[:user_id] = 2 # permissions are hard
1715
end
1816

spec/controllers/workflows_controller_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
@response = ActionDispatch::TestResponse.new
1414
Setting.default_language = 'en'
1515
User.current = nil
16+
@request.session = ActionController::TestSession.new
1617
@request.session[:user_id] = 1 # permissions admin
1718
end
1819

0 commit comments

Comments
 (0)