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

Make the bim seeding test more complete

Christophe Bliard0a9a78863d9d
diff --git a/modules/bim/spec/seeders/root_seeder_bim_edition_spec.rb b/modules/bim/spec/seeders/root_seeder_bim_edition_spec.rb
index ac784dc77c3..df2181ce445 100644
--- a/modules/bim/spec/seeders/root_seeder_bim_edition_spec.rb
+++ b/modules/bim/spec/seeders/root_seeder_bim_edition_spec.rb
@@ -57,23 +57,6 @@ describe RootSeeder,
expect(Relation.follows.count).to eq 35
expect(WorkPackage.where.not(parent: nil).count).to eq 55
end
- end
-
- describe 'demo data' do
- before_all do
- RSpec::Mocks.with_temporary_scope do
- # the mocking of settings and configuration is duplicated here because
- # it's executed outside of an example context
- with_config(edition: 'bim')
- with_settings(journal_aggregation_time_minutes: 0)
-
- described_class.new.seed_data!
- end
- end
-
- include_examples 'creates BIM demo data'
-
- include_examples 'no email deliveries'
it 'assigns work packages to groups' do
count_by_assignee =
@@ -81,7 +64,7 @@ describe RootSeeder,
.joins(:assigned_to)
.group("array_to_string(ARRAY[type || ':', firstname, lastname], ' ')")
.count
- .transform_keys!(&:squish)
+ .transform_keys! { |key| key.squish.gsub('tr: ', '') }
expect(count_by_assignee).to eq(
"Group: Architects" => 1,
"Group: BIM Coordinators" => 11,
@@ -94,6 +77,23 @@ describe RootSeeder,
end
end
+ describe 'demo data' do
+ before_all do
+ RSpec::Mocks.with_temporary_scope do
+ # the mocking of settings and configuration is duplicated here because
+ # it's executed outside of an example context
+ with_config(edition: 'bim')
+ with_settings(journal_aggregation_time_minutes: 0)
+
+ described_class.new.seed_data!
+ end
+ end
+
+ include_examples 'creates BIM demo data'
+
+ include_examples 'no email deliveries'
+ end
+
describe 'demo data translated in another language' do
before_all do
RSpec::Mocks.with_temporary_scope do