Actions
Maintenance #2173
closedxmera Omnia - Collection #1826: Maintenance tasks of several components
xmera Omnia - Maintenance #2123: Support Redmine 5.1.3
Fix project_query_test
Start date:
06/24/2024
Due date:
06/24/2024
% Done:
100%
Estimated time:
Compatible Redmine Version:
Pull Request Link:
Description
The failing tests needs to be overriden since ==
for ActiveRecord::Relation
will compare the sql representation what is different:
[701, 710] in /home/liane-xmera/redmine/gem_home/gems/activerecord-6.1.7.8/lib/active_record/relation.rb
701: def ==(other)
702: case other
703: when Associations::CollectionProxy, AssociationRelation
704: self == other.records
705: when Relation
=> 706: other.to_sql == to_sql
707: when Array
708: records == other
709: end
710: end
(byebug) other.to_sql
"SELECT `projects`.* FROM `projects` WHERE `projects`.`is_project_type` = FALSE"
(byebug) to_sql
"SELECT `projects`.* FROM `projects`"
FAIL ProjectQueryTest#test_base_scope_should_return_all_projects_when_admin_projects_is_set (347.20s)
No visible difference in the Project::ActiveRecord_Relation#inspect output.
You should look at the implementation of #== on Project::ActiveRecord_Relation or its members.
#<ActiveRecord::Relation [#<Project id: 1, name: "eCookbook", description: "Recipes management application", homepage: "http://ecookbook.somenet.foo/", is_public: true, parent_id: nil, created_on: "2006-07-19 17:13:59.000000000 +0000", updated_on: "2006-07-19 20:53:01.000000000 +0000", identifier: "ecookbook", status: 1, lft: 1, rgt: 10, inherit_members: false, default_version_id: nil, default_assigned_to_id: nil, default_issue_query_id: nil, dmsf_description: nil, dmsf_notification: false, dmsf_act_as_attachable: 1, default_dmsf_query_id: nil, project_type_id: nil, is_project_type: false>, #<Project id: 2, name: "OnlineStore", description: "E-commerce web site", homepage: "", is_public: false, parent_id: nil, created_on: "2006-07-19 17:14:19.000000000 +0000", updated_on: "2006-07-19 17:14:19.000000000 +0000", identifier: "onlinestore", status: 1, lft: 11, rgt: 12, inherit_members: false, default_version_id: nil, default_assigned_to_id: nil, default_issue_query_id: nil, dmsf_description: nil, dmsf_notification: false, dmsf_act_as_attachable: 1, default_dmsf_query_id: nil, project_type_id: nil, is_project_type: false>, #<Project id: 3, name: "eCookbook Subproject 1", description: "eCookBook Subproject 1", homepage: "", is_public: true, parent_id: 1, created_on: "2006-07-19 17:15:21.000000000 +0000", updated_on: "2006-07-19 17:18:12.000000000 +0000", identifier: "subproject1", status: 1, lft: 6, rgt: 7, inherit_members: false, default_version_id: nil, default_assigned_to_id: nil, default_issue_query_id: nil, dmsf_description: nil, dmsf_notification: false, dmsf_act_as_attachable: 1, default_dmsf_query_id: nil, project_type_id: nil, is_project_type: false>, #<Project id: 4, name: "eCookbook Subproject 2", description: "eCookbook Subproject 2", homepage: "", is_public: true, parent_id: 1, created_on: "2006-07-19 17:15:51.000000000 +0000", updated_on: "2006-07-19 17:17:07.000000000 +0000", identifier: "subproject2", status: 1, lft: 8, rgt: 9, inherit_members: false, default_version_id: nil, default_assigned_to_id: nil, default_issue_query_id: nil, dmsf_description: nil, dmsf_notification: false, dmsf_act_as_attachable: 1, default_dmsf_query_id: nil, project_type_id: nil, is_project_type: false>, #<Project id: 5, name: "Private child of eCookbook", description: "This is a private subproject of a public project", homepage: "", is_public: false, parent_id: 1, created_on: "2006-07-19 17:15:51.000000000 +0000", updated_on: "2006-07-19 17:17:07.000000000 +0000", identifier: "private-child", status: 1, lft: 2, rgt: 5, inherit_members: false, default_version_id: nil, default_assigned_to_id: nil, default_issue_query_id: nil, dmsf_description: nil, dmsf_notification: false, dmsf_act_as_attachable: 1, default_dmsf_query_id: nil, project_type_id: nil, is_project_type: false>, #<Project id: 6, name: "Child of private child", description: "This is a public subproject of a private project", homepage: "", is_public: true, parent_id: 5, created_on: "2006-07-19 17:15:51.000000000 +0000", updated_on: "2006-07-19 17:17:07.000000000 +0000", identifier: "project6", status: 1, lft: 3, rgt: 4, inherit_members: false, default_version_id: nil, default_assigned_to_id: nil, default_issue_query_id: nil, dmsf_description: nil, dmsf_notification: false, dmsf_act_as_attachable: 1, default_dmsf_query_id: nil, project_type_id: nil, is_project_type: false>]>
test/unit/project_query_test.rb:150:in `test_base_scope_should_return_all_projects_when_admin_projects_is_set'
FAIL ProjectQueryTest#test_base_scope_should_return_visible_projects (436.81s)
No visible difference in the Project::ActiveRecord_Relation#inspect output.
You should look at the implementation of #== on Project::ActiveRecord_Relation or its members.
#<ActiveRecord::Relation [#<Project id: 1, name: "eCookbook", description: "Recipes management application", homepage: "http://ecookbook.somenet.foo/", is_public: true, parent_id: nil, created_on: "2006-07-19 17:13:59.000000000 +0000", updated_on: "2006-07-19 20:53:01.000000000 +0000", identifier: "ecookbook", status: 1, lft: 1, rgt: 10, inherit_members: false, default_version_id: nil, default_assigned_to_id: nil, default_issue_query_id: nil, dmsf_description: nil, dmsf_notification: false, dmsf_act_as_attachable: 1, default_dmsf_query_id: nil, project_type_id: nil, is_project_type: false>, #<Project id: 3, name: "eCookbook Subproject 1", description: "eCookBook Subproject 1", homepage: "", is_public: true, parent_id: 1, created_on: "2006-07-19 17:15:21.000000000 +0000", updated_on: "2006-07-19 17:18:12.000000000 +0000", identifier: "subproject1", status: 1, lft: 6, rgt: 7, inherit_members: false, default_version_id: nil, default_assigned_to_id: nil, default_issue_query_id: nil, dmsf_description: nil, dmsf_notification: false, dmsf_act_as_attachable: 1, default_dmsf_query_id: nil, project_type_id: nil, is_project_type: false>, #<Project id: 4, name: "eCookbook Subproject 2", description: "eCookbook Subproject 2", homepage: "", is_public: true, parent_id: 1, created_on: "2006-07-19 17:15:51.000000000 +0000", updated_on: "2006-07-19 17:17:07.000000000 +0000", identifier: "subproject2", status: 1, lft: 8, rgt: 9, inherit_members: false, default_version_id: nil, default_assigned_to_id: nil, default_issue_query_id: nil, dmsf_description: nil, dmsf_notification: false, dmsf_act_as_attachable: 1, default_dmsf_query_id: nil, project_type_id: nil, is_project_type: false>, #<Project id: 6, name: "Child of private child", description: "This is a public subproject of a private project", homepage: "", is_public: true, parent_id: 5, created_on: "2006-07-19 17:15:51.000000000 +0000", updated_on: "2006-07-19 17:17:07.000000000 +0000", identifier: "project6", status: 1, lft: 3, rgt: 4, inherit_members: false, default_version_id: nil, default_assigned_to_id: nil, default_issue_query_id: nil, dmsf_description: nil, dmsf_notification: false, dmsf_act_as_attachable: 1, default_dmsf_query_id: nil, project_type_id: nil, is_project_type: false>]>
test/unit/project_query_test.rb:144:in `test_base_scope_should_return_visible_projects'
Actions