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

adjust order of code in spec for readability

ulfertsa369ebaa949a
diff --git a/spec/migrations/update_progress_calculation_spec.rb b/spec/migrations/update_progress_calculation_spec.rb
index 1b88d9ff75f..1895179a257 100644
--- a/spec/migrations/update_progress_calculation_spec.rb
+++ b/spec/migrations/update_progress_calculation_spec.rb
@@ -692,18 +692,25 @@ RSpec.describe UpdateProgressCalculation, type: :model do
end
describe "error during job execution" do
+ let_work_packages(<<~TABLE)
+ subject | work | remaining work | % complete | ∑ work | ∑ remaining work | ∑ % complete
+ wp working | | 4h | 60% | 10h | 4h | 60%
+ wp breaking | | 4h | 60% | 10h | 4h | 60%
+ TABLE
+
before do
Setting.work_package_done_ratio = "field"
- allow(Journals::CreateService)
- .to receive(:new)
- .with(wp_breaking, User.system)
- .and_return(nil)
allow(Journals::CreateService)
.to receive(:new)
.with(wp_working, User.system)
.and_call_original
+ allow(Journals::CreateService)
+ .to receive(:new)
+ .with(wp_breaking, User.system)
+ .and_return(nil)
+
ActiveRecord::Migration.suppress_messages { described_class.new.up }
begin
@@ -712,12 +719,6 @@ RSpec.describe UpdateProgressCalculation, type: :model do
end
end
- let_work_packages(<<~TABLE)
- subject | work | remaining work | % complete | ∑ work | ∑ remaining work | ∑ % complete
- wp working | | 4h | 60% | 10h | 4h | 60%
- wp breaking | | 4h | 60% | 10h | 4h | 60%
- TABLE
-
it "does not create a journal entry" do
table_work_packages.each do |wp|
expect(wp.journals.count).to eq(1)