OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Fix scope related specs
Dombi Attila20bed2db52db
diff --git a/spec/lib/custom_field_form_builder_spec.rb b/spec/lib/custom_field_form_builder_spec.rbindex 06337c5ed12..f5563b63efa 100644--- a/spec/lib/custom_field_form_builder_spec.rb+++ b/spec/lib/custom_field_form_builder_spec.rb@@ -1,3 +1,5 @@+# frozen_string_literal: true+#-- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbH@@ -57,6 +59,8 @@ RSpec.describe CustomFieldFormBuilder dobuild_stubbed(:user)end+ let(:scope) { instance_double(ActiveRecord::Relation) }+before dowithout_partial_double_verification doallow(resource)@@ -255,7 +259,6 @@ RSpec.describe CustomFieldFormBuilder dolet(:project) { build_stubbed(:project) }let(:user1) { build_stubbed(:user) }let(:user2) { build_stubbed(:user) }- let(:scope) { instance_double(ActiveRecord::Relation) }let(:resource) { project }@@ -273,8 +276,10 @@ RSpec.describe CustomFieldFormBuilder do.and_return(scope)allow(scope)- .to receive(:select)- .and_return([user1, user2])+ .to receive_messages(+ select: [user1, user2],+ includes: scope+ )endit_behaves_like "wrapped in container", "select-container" do@@ -331,6 +336,10 @@ RSpec.describe CustomFieldFormBuilder doallow(project).to receive(:shared_versions)+ .and_return(scope)++ allow(scope)+ .to receive(:includes).and_return([version1, version2])endenddiff --git a/spec/models/custom_actions/actions/custom_field_spec.rb b/spec/models/custom_actions/actions/custom_field_spec.rbindex afc2c54b1f0..04ec6aaf8ce 100644--- a/spec/models/custom_actions/actions/custom_field_spec.rb+++ b/spec/models/custom_actions/actions/custom_field_spec.rb@@ -29,6 +29,7 @@ require "spec_helper"require_relative "../shared_expectations"RSpec.describe CustomActions::Actions::CustomField do+ let(:scope) { instance_double(ActiveRecord::Relation) }let(:list_custom_field) dobuild_stubbed(:list_wp_custom_field,custom_options: [build_stubbed(:custom_option, value: "A"),@@ -406,9 +407,13 @@ RSpec.describe CustomActions::Actions::CustomField dolet(:versions) { [z_version, a_version, m_version] }before do+ allow(scope)+ .to receive(:includes)+ .and_return(versions)+allow(Version).to receive(:systemwide)- .and_return(versions)+ .and_return(scope)endcontext "for a non required field" do@@ -441,7 +446,6 @@ RSpec.describe CustomActions::Actions::CustomField dobuild_stubbed(:user),build_stubbed(:user)]end- let(:scope) { instance_double(ActiveRecord::Relation) }before doallow(Principal)@@ -520,7 +524,6 @@ RSpec.describe CustomActions::Actions::CustomField dobuild_stubbed(:user),build_stubbed(:user)]end- let(:scope) { instance_double(ActiveRecord::Relation) }before doallow(Principal)@@ -551,9 +554,13 @@ RSpec.describe CustomActions::Actions::CustomField doendbefore do+ allow(scope)+ .to receive(:includes)+ .and_return(versions)+allow(Version).to receive(:systemwide)- .and_return(versions)+ .and_return(scope)endit_behaves_like "associated custom action validations" do