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

adapt spec setups

ulfertsc3de93c5ba2f
diff --git a/spec/models/projects/exporter/csv_integration_spec.rb b/spec/models/projects/exporter/csv_integration_spec.rb
index 8f72518e42b..325c1a36301 100644
--- a/spec/models/projects/exporter/csv_integration_spec.rb
+++ b/spec/models/projects/exporter/csv_integration_spec.rb
@@ -48,9 +48,7 @@ RSpec.describe Projects::Exports::CSV, 'integration' do
end
context 'with status_explanation enabled' do
- before do
- Setting.enabled_projects_columns += ["status_explanation"]
- end
+ let(:query_columns) { %w[name description project_status status_explanation public] }
it 'performs a successful export' do
expect(parsed.size).to eq(2)
@@ -61,8 +59,8 @@ RSpec.describe Projects::Exports::CSV, 'integration' do
end
describe 'custom field columns selected' do
- before do
- Setting.enabled_projects_columns += custom_fields.map(&:column_name)
+ let(:query_columns) do
+ %w[name description project_status public] + custom_fields.map(&:column_name)
end
context 'when ee enabled', with_ee: %i[custom_fields_in_projects_list] do
diff --git a/spec/services/custom_fields/create_service_spec.rb b/spec/services/custom_fields/create_service_spec.rb
index 3e4a2abc0a4..a169bc39205 100644
--- a/spec/services/custom_fields/create_service_spec.rb
+++ b/spec/services/custom_fields/create_service_spec.rb
@@ -31,7 +31,8 @@ require 'services/base_services/behaves_like_create_service'
RSpec.describe CustomFields::CreateService, type: :model do
it_behaves_like 'BaseServices create service' do
- context 'when creating a project cf' do
+ context 'when creating a project cf',
+ with_ee: %i[custom_fields_in_projects_list] do
let(:model_instance) { build_stubbed(:project_custom_field) }
it 'modifies the settings on successful call' do