Skip to content

Commit

Permalink
Merge pull request agileware-jp#73 from agileware-jp/feature/69309_en…
Browse files Browse the repository at this point in the history
…able_ruby31

support Ruby 3.1
  • Loading branch information
telegib authored May 8, 2023
2 parents e1a1424 + ca4829c commit df3472d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 24 deletions.
41 changes: 24 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
redmine-plugin: agileware-jp/redmine-plugin@2.3.0
redmine-plugin: agileware-jp/redmine-plugin@3.1.0
plugin-test:
commands:
run-tests:
Expand Down Expand Up @@ -65,14 +65,11 @@ jobs:
type: string
ruby_version:
type: string
default: '2.7'
db:
type: enum
enum: ['mysql', 'pg']
default: pg
db_version:
type: string
default: 'latest-ram'
executor:
name: redmine-plugin/ruby-<< parameters.db >>
ruby_version: << parameters.ruby_version >>
Expand All @@ -85,27 +82,37 @@ jobs:
- redmine-plugin/generate-database_yml
- redmine-plugin/bundle-install
- redmine-plugin/rspec

default_context: &default_context
context:
- lychee-ci-environment

workflows:
run-tests-workflow:
jobs:
- run-tests:
name: test on newest versions with PostgreSQL
<<: *default_context
name: test on supported maximum versions with PostgreSQ
redmine_version: $REDMINE_MAX_VERSION
ruby_version: $RUBY_MAX_VERSION
database: pg
ruby_version: '2.7'
redmine_version: 'latest'
- run-tests:
name: test on oldest versions with MySQL
<<: *default_context
name: test on supported minimum versions with MySQL
redmine_version: $REDMINE_MIN_VERSION
ruby_version: $RUBY_MIN_VERSION
database: mysql
ruby_version: '2.6'
redmine_version: '4.2.9'
- rspec:
name: RSpec on newest versions with PostgreSQL
redmine_version: latest
ruby_version: '2.7'
<<: *default_context
name: RSpec on supported maximum versions with PostgreSQL
redmine_version: $REDMINE_MAX_VERSION
ruby_version: $RUBY_MAX_VERSION
db: pg
db_version: $POSTGRES_VERSION
- rspec:
name: RSpec on oldest versions with MySQL
redmine_version: '4.2.9'
ruby_version: '2.6'
<<: *default_context
name: RSpec on supported minimum versions with MySQL
redmine_version: $REDMINE_MIN_VERSION
ruby_version: $RUBY_MIN_VERSION
db: mysql
db_version: '5.7-ram'
db_version: $MYSQL_VERSION
28 changes: 21 additions & 7 deletions spec/features/drag_and_drop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@

# change id: 1, 2, 3, 4 to 4, 1, 2, 3
expect do
first_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(first_target.native, 0, 90).perform :
first_target.drag_to(last_target)
wait_for_ajax
end.to change {
IssueTemplate.order(:id).pluck(:position).to_a
Expand All @@ -42,7 +44,9 @@
last_target = table.find('tr:nth-child(4) > td.buttons > span')

expect do
second_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(second_target.native, 0, 60).perform :
second_target.drag_to(last_target)
wait_for_ajax
end.to change {
IssueTemplate.order(:id).pluck(:position).to_a
Expand All @@ -66,7 +70,9 @@
#--------------------------------------------
# change position: 1, 2, 3, 4 to 4, 1, 2, 3
expect do
first_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(first_target.native, 0, 90).perform :
first_target.drag_to(last_target)
wait_for_ajax
end.to change {
NoteTemplate.reorder(:id).pluck(:position).to_a
Expand All @@ -79,7 +85,9 @@
last_target = table.find('tr:nth-child(4) > td.buttons > span')

expect do
second_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(second_target.native, 0, 60).perform :
second_target.drag_to(last_target)
wait_for_ajax
end.to change {
NoteTemplate.reorder(:id).pluck(:position).to_a
Expand Down Expand Up @@ -109,7 +117,9 @@
first_target = table.find("tr:nth-child(#{tr_idx.first}) > td.buttons > span")
last_target = table.find("tr:nth-child(#{tr_idx.last}) > td.buttons > span")

first_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(first_target.native, 0, 30).perform :
first_target.drag_to(last_target)
wait_for_ajax
tr_idx.reverse!
end
Expand All @@ -135,7 +145,9 @@

# change id: 1, 2, 3, 4 to 4, 1, 2, 3
expect do
first_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(first_target.native, 0, 90).perform :
first_target.drag_to(last_target)
wait_for_ajax
end.to change {
GlobalIssueTemplate.reorder(:id).pluck(:position).to_a
Expand All @@ -146,7 +158,9 @@
last_target = table.find('tr:nth-child(4) > td.buttons > span')

expect do
second_target.drag_to(last_target)
Redmine::VERSION::STRING < '4.2' ?
page.driver.browser.action.drag_and_drop_by(second_target.native, 0, 60).perform :
second_target.drag_to(last_target)
wait_for_ajax
end.to change {
GlobalIssueTemplate.reorder(:id).pluck(:position).to_a
Expand Down

0 comments on commit df3472d

Please sign in to comment.