Skip to content

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

Fix rubocop issues and failing specs

Dombi Attilabeab112ef7c8
diff --git a/app/models/project/life_cycle_step_definition.rb b/app/models/project/life_cycle_step_definition.rb
index 7dadf61f992..767483d8fce 100644
--- a/app/models/project/life_cycle_step_definition.rb
+++ b/app/models/project/life_cycle_step_definition.rb
@@ -30,6 +30,7 @@ class Project::LifeCycleStepDefinition < ApplicationRecord
has_many :life_cycle_steps,
class_name: "Project::LifeCycleStep",
foreign_key: :definition_id,
+ inverse_of: :definition,
dependent: :destroy
has_many :projects, through: :life_cycle_steps
belongs_to :color, optional: false
diff --git a/spec/seeders/root_seeder_standard_edition_spec.rb b/spec/seeders/root_seeder_standard_edition_spec.rb
index 63673e053d0..af0561b82d9 100644
--- a/spec/seeders/root_seeder_standard_edition_spec.rb
+++ b/spec/seeders/root_seeder_standard_edition_spec.rb
@@ -63,8 +63,8 @@ RSpec.describe RootSeeder,
expect(VersionSetting.count).to eq 4
expect(Boards::Grid.count).to eq 5
expect(Boards::Grid.count { |grid| grid.options.has_key?(:filters) }).to eq 1
- expect(Stage.count).to eq 4
- expect(Gate.count).to eq 3
+ expect(Project::StageDefinition.count).to eq 4
+ expect(Project::GateDefinition.count).to eq 3
end
it "links work packages to their version" do
@@ -173,8 +173,8 @@ RSpec.describe RootSeeder,
expect(Version.count).to eq 4
expect(VersionSetting.count).to eq 4
expect(Boards::Grid.count).to eq 5
- expect(Stage.count).to eq 4
- expect(Gate.count).to eq 3
+ expect(Project::StageDefinition.count).to eq 4
+ expect(Project::GateDefinition.count).to eq 3
end
end
end
diff --git a/spec/support/shared/project_life_cycle_helpers.rb b/spec/support/shared/project_life_cycle_helpers.rb
index 9dff4aa8792..44e8ecca80c 100644
--- a/spec/support/shared/project_life_cycle_helpers.rb
+++ b/spec/support/shared/project_life_cycle_helpers.rb
@@ -32,7 +32,7 @@ RSpec.shared_examples_for "a Project::LifeCycleStepDefinition event" do
end
describe "associations" do
- it { is_expected.to have_many(:life_cycle_steps).dependent(:destroy) }
+ it { is_expected.to have_many(:life_cycle_steps).inverse_of(:definition).dependent(:destroy) }
it { is_expected.to have_many(:projects).through(:life_cycle_steps) }
it { is_expected.to belong_to(:color).required }
end