From 67020110c44852a3a2a8e692287dab0a619babb0 Mon Sep 17 00:00:00 2001 From: tohosaku Date: Fri, 10 Dec 2021 22:57:43 +0000 Subject: [PATCH 3/4] Replace to_s(:db) to to_fs(:db) see https://github.com/rails/rails/pull/43772 --- test/fixtures/issues.yml | 84 +++++++++++++++++++------------------- test/fixtures/journals.yml | 10 ++--- test/fixtures/messages.yml | 12 +++--- test/fixtures/versions.yml | 2 +- test/unit/query_test.rb | 4 +- 5 files changed, 56 insertions(+), 56 deletions(-) diff --git a/test/fixtures/issues.yml b/test/fixtures/issues.yml index 1c2c37fa5..7092c176a 100644 --- a/test/fixtures/issues.yml +++ b/test/fixtures/issues.yml @@ -1,8 +1,8 @@ --- issues_001: - created_on: <%= 3.days.ago.to_s(:db) %> + created_on: <%= 3.days.ago.to_fs(:db) %> project_id: 1 - updated_on: <%= 1.day.ago.to_s(:db) %> + updated_on: <%= 1.day.ago.to_fs(:db) %> priority_id: 4 subject: Cannot print recipes id: 1 @@ -13,8 +13,8 @@ issues_001: assigned_to_id: author_id: 2 status_id: 1 - start_date: <%= 1.day.ago.to_date.to_s(:db) %> - due_date: <%= 10.day.from_now.to_date.to_s(:db) %> + start_date: <%= 1.day.ago.to_date.to_fs(:db) %> + due_date: <%= 10.day.from_now.to_date.to_fs(:db) %> estimated_hours: 200.0 root_id: 1 lft: 1 @@ -34,7 +34,7 @@ issues_002: assigned_to_id: 3 author_id: 2 status_id: 2 - start_date: <%= 2.day.ago.to_date.to_s(:db) %> + start_date: <%= 2.day.ago.to_date.to_fs(:db) %> due_date: estimated_hours: 0.5 root_id: 2 @@ -56,16 +56,16 @@ issues_003: assigned_to_id: 3 author_id: 2 status_id: 1 - start_date: <%= 15.day.ago.to_date.to_s(:db) %> - due_date: <%= 5.day.ago.to_date.to_s(:db) %> + start_date: <%= 15.day.ago.to_date.to_fs(:db) %> + due_date: <%= 5.day.ago.to_date.to_fs(:db) %> estimated_hours: 1.0 root_id: 3 lft: 1 rgt: 2 issues_004: - created_on: <%= 5.days.ago.to_s(:db) %> + created_on: <%= 5.days.ago.to_fs(:db) %> project_id: 2 - updated_on: <%= 2.days.ago.to_s(:db) %> + updated_on: <%= 2.days.ago.to_fs(:db) %> priority_id: 4 subject: Issue on project 2 id: 4 @@ -80,9 +80,9 @@ issues_004: lft: 1 rgt: 2 issues_005: - created_on: <%= 5.days.ago.to_s(:db) %> + created_on: <%= 5.days.ago.to_fs(:db) %> project_id: 3 - updated_on: <%= 2.days.ago.to_s(:db) %> + updated_on: <%= 2.days.ago.to_fs(:db) %> priority_id: 4 subject: Subproject issue id: 5 @@ -98,9 +98,9 @@ issues_005: lft: 1 rgt: 2 issues_006: - created_on: <%= 1.minute.ago.to_s(:db) %> + created_on: <%= 1.minute.ago.to_fs(:db) %> project_id: 5 - updated_on: <%= 1.minute.ago.to_s(:db) %> + updated_on: <%= 1.minute.ago.to_fs(:db) %> priority_id: 4 subject: Issue of a private subproject id: 6 @@ -111,15 +111,15 @@ issues_006: assigned_to_id: author_id: 2 status_id: 1 - start_date: <%= Date.today.to_s(:db) %> - due_date: <%= 1.days.from_now.to_date.to_s(:db) %> + start_date: <%= Date.today.to_fs(:db) %> + due_date: <%= 1.days.from_now.to_date.to_fs(:db) %> root_id: 6 lft: 1 rgt: 2 issues_007: - created_on: <%= 10.days.ago.to_s(:db) %> + created_on: <%= 10.days.ago.to_fs(:db) %> project_id: 1 - updated_on: <%= 10.days.ago.to_s(:db) %> + updated_on: <%= 10.days.ago.to_fs(:db) %> priority_id: 5 subject: Issue due today id: 7 @@ -130,16 +130,16 @@ issues_007: assigned_to_id: author_id: 2 status_id: 1 - start_date: <%= 10.days.ago.to_s(:db) %> - due_date: <%= Date.today.to_s(:db) %> + start_date: <%= 10.days.ago.to_fs(:db) %> + due_date: <%= Date.today.to_fs(:db) %> lock_version: 0 root_id: 7 lft: 1 rgt: 2 issues_008: - created_on: <%= 10.days.ago.to_s(:db) %> + created_on: <%= 10.days.ago.to_fs(:db) %> project_id: 1 - updated_on: <%= 10.days.ago.to_s(:db) %> + updated_on: <%= 10.days.ago.to_fs(:db) %> priority_id: 5 subject: Closed issue id: 8 @@ -156,11 +156,11 @@ issues_008: root_id: 8 lft: 1 rgt: 2 - closed_on: <%= 3.days.ago.to_s(:db) %> + closed_on: <%= 3.days.ago.to_fs(:db) %> issues_009: - created_on: <%= 1.minute.ago.to_s(:db) %> + created_on: <%= 1.minute.ago.to_fs(:db) %> project_id: 5 - updated_on: <%= 1.minute.ago.to_s(:db) %> + updated_on: <%= 1.minute.ago.to_fs(:db) %> priority_id: 5 subject: Blocked Issue id: 9 @@ -171,15 +171,15 @@ issues_009: assigned_to_id: author_id: 2 status_id: 1 - start_date: <%= Date.today.to_s(:db) %> - due_date: <%= 1.days.from_now.to_date.to_s(:db) %> + start_date: <%= Date.today.to_fs(:db) %> + due_date: <%= 1.days.from_now.to_date.to_fs(:db) %> root_id: 9 lft: 1 rgt: 2 issues_010: - created_on: <%= 1.minute.ago.to_s(:db) %> + created_on: <%= 1.minute.ago.to_fs(:db) %> project_id: 5 - updated_on: <%= 1.minute.ago.to_s(:db) %> + updated_on: <%= 1.minute.ago.to_fs(:db) %> priority_id: 5 subject: Issue Doing the Blocking id: 10 @@ -190,15 +190,15 @@ issues_010: assigned_to_id: author_id: 2 status_id: 1 - start_date: <%= Date.today.to_s(:db) %> - due_date: <%= 1.days.from_now.to_date.to_s(:db) %> + start_date: <%= Date.today.to_fs(:db) %> + due_date: <%= 1.days.from_now.to_date.to_fs(:db) %> root_id: 10 lft: 1 rgt: 2 issues_011: - created_on: <%= 3.days.ago.to_s(:db) %> + created_on: <%= 3.days.ago.to_fs(:db) %> project_id: 1 - updated_on: <%= 1.day.ago.to_s(:db) %> + updated_on: <%= 1.day.ago.to_fs(:db) %> priority_id: 5 subject: Closed issue on a closed version id: 11 @@ -209,16 +209,16 @@ issues_011: assigned_to_id: author_id: 2 status_id: 5 - start_date: <%= 1.day.ago.to_date.to_s(:db) %> + start_date: <%= 1.day.ago.to_date.to_fs(:db) %> due_date: root_id: 11 lft: 1 rgt: 2 - closed_on: <%= 1.day.ago.to_s(:db) %> + closed_on: <%= 1.day.ago.to_fs(:db) %> issues_012: - created_on: <%= 3.days.ago.to_s(:db) %> + created_on: <%= 3.days.ago.to_fs(:db) %> project_id: 1 - updated_on: <%= 1.day.ago.to_s(:db) %> + updated_on: <%= 1.day.ago.to_fs(:db) %> priority_id: 5 subject: Closed issue on a locked version id: 12 @@ -229,16 +229,16 @@ issues_012: assigned_to_id: author_id: 3 status_id: 5 - start_date: <%= 1.day.ago.to_date.to_s(:db) %> + start_date: <%= 1.day.ago.to_date.to_fs(:db) %> due_date: root_id: 12 lft: 1 rgt: 2 - closed_on: <%= 1.day.ago.to_s(:db) %> + closed_on: <%= 1.day.ago.to_fs(:db) %> issues_013: - created_on: <%= 5.days.ago.to_s(:db) %> + created_on: <%= 5.days.ago.to_fs(:db) %> project_id: 3 - updated_on: <%= 2.days.ago.to_s(:db) %> + updated_on: <%= 2.days.ago.to_fs(:db) %> priority_id: 4 subject: Subproject issue two id: 13 @@ -254,9 +254,9 @@ issues_013: rgt: 2 issues_014: id: 14 - created_on: <%= 15.days.ago.to_s(:db) %> + created_on: <%= 15.days.ago.to_fs(:db) %> project_id: 3 - updated_on: <%= 15.days.ago.to_s(:db) %> + updated_on: <%= 15.days.ago.to_fs(:db) %> priority_id: 5 subject: Private issue on public project fixed_version_id: diff --git a/test/fixtures/journals.yml b/test/fixtures/journals.yml index bc7bc91b9..aedfd8dbb 100644 --- a/test/fixtures/journals.yml +++ b/test/fixtures/journals.yml @@ -1,27 +1,27 @@ --- journals_001: - created_on: <%= 2.days.ago.to_date.to_s(:db) %> + created_on: <%= 2.days.ago.to_date.to_fs(:db) %> notes: "Journal notes" id: 1 journalized_type: Issue user_id: 1 journalized_id: 1 journals_002: - created_on: <%= 1.days.ago.to_date.to_s(:db) %> + created_on: <%= 1.days.ago.to_date.to_fs(:db) %> notes: "Some notes with Redmine links: #2, r2." id: 2 journalized_type: Issue user_id: 2 journalized_id: 1 journals_003: - created_on: <%= 1.days.ago.to_date.to_s(:db) %> + created_on: <%= 1.days.ago.to_date.to_fs(:db) %> notes: "A comment with inline image: !picture.jpg! and a reference to #1 and r2." id: 3 journalized_type: Issue user_id: 2 journalized_id: 2 journals_004: - created_on: <%= 1.days.ago.to_date.to_s(:db) %> + created_on: <%= 1.days.ago.to_date.to_fs(:db) %> notes: "A comment with a private version." id: 4 journalized_type: Issue @@ -29,7 +29,7 @@ journals_004: journalized_id: 6 journals_005: id: 5 - created_on: <%= 1.days.ago.to_date.to_s(:db) %> + created_on: <%= 1.days.ago.to_date.to_fs(:db) %> notes: "A comment on a private issue." user_id: 2 journalized_type: Issue diff --git a/test/fixtures/messages.yml b/test/fixtures/messages.yml index b193599d5..5b5fbed35 100644 --- a/test/fixtures/messages.yml +++ b/test/fixtures/messages.yml @@ -45,8 +45,8 @@ messages_004: parent_id: board_id: 1 messages_005: - created_on: <%= 3.days.ago.to_date.to_s(:db) %> - updated_on: <%= 3.days.ago.to_date.to_s(:db) %> + created_on: <%= 3.days.ago.to_date.to_fs(:db) %> + updated_on: <%= 3.days.ago.to_date.to_fs(:db) %> subject: 'RE: post 2' id: 5 replies_count: 0 @@ -56,8 +56,8 @@ messages_005: parent_id: 4 board_id: 1 messages_006: - created_on: <%= 2.days.ago.to_date.to_s(:db) %> - updated_on: <%= 2.days.ago.to_date.to_s(:db) %> + created_on: <%= 2.days.ago.to_date.to_fs(:db) %> + updated_on: <%= 2.days.ago.to_date.to_fs(:db) %> subject: 'RE: post 2' id: 6 replies_count: 0 @@ -67,8 +67,8 @@ messages_006: parent_id: 4 board_id: 1 messages_007: - created_on: <%= 2.days.ago.to_date.to_s(:db) %> - updated_on: <%= 2.days.ago.to_date.to_s(:db) %> + created_on: <%= 2.days.ago.to_date.to_fs(:db) %> + updated_on: <%= 2.days.ago.to_date.to_fs(:db) %> subject: 'Message on a private project' id: 7 replies_count: 0 diff --git a/test/fixtures/versions.yml b/test/fixtures/versions.yml index 8312666e4..c0c733702 100644 --- a/test/fixtures/versions.yml +++ b/test/fixtures/versions.yml @@ -16,7 +16,7 @@ versions_002: updated_on: 2006-07-19 21:00:33 +02:00 id: 2 description: Stable release - effective_date: <%= 20.day.from_now.to_date.to_s(:db) %> + effective_date: <%= 20.day.from_now.to_date.to_fs(:db) %> status: locked sharing: 'none' wiki_page_title: ECookBookV1 diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index 3a9655466..db9b0c6a7 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -1209,13 +1209,13 @@ class QueryTest < ActiveSupport::TestCase query = IssueQuery.new(:name => '_') filter_name = "fixed_version.due_date" assert_include filter_name, query.available_filters.keys - query.filters = {filter_name => {:operator => '=', :values => [20.day.from_now.to_date.to_s(:db)]}} + query.filters = {filter_name => {:operator => '=', :values => [20.day.from_now.to_date.to_fs(:db)]}} issues = find_issues_with_query(query) assert_equal [2], issues.map(&:fixed_version_id).uniq.sort assert_equal [2, 12], issues.map(&:id).sort query = IssueQuery.new(:name => '_') - query.filters = {filter_name => {:operator => '>=', :values => [21.day.from_now.to_date.to_s(:db)]}} + query.filters = {filter_name => {:operator => '>=', :values => [21.day.from_now.to_date.to_fs(:db)]}} assert_equal 0, find_issues_with_query(query).size end -- 2.30.2