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

Move general project settings spec, fix copy spec

Dombi Attila1d4517d0951d
diff --git a/spec/features/projects/copy_spec.rb b/spec/features/projects/copy_spec.rb
index 33c71a614ea..e339e21f3ae 100644
--- a/spec/features/projects/copy_spec.rb
+++ b/spec/features/projects/copy_spec.rb
@@ -100,7 +100,8 @@ RSpec.describe "Projects copy", :js, :with_cuprite,
manage_files_in_project
manage_file_links
work_package_assigned
- view_project_attributes)
+ view_project_attributes
+ edit_project_attributes)
end
let(:wp_user) do
user = create(:user)
diff --git a/spec/features/projects/edit_settings_spec.rb b/spec/features/projects/edit_settings_spec.rb
index c816ae5f721..bf59f279bca 100644
--- a/spec/features/projects/edit_settings_spec.rb
+++ b/spec/features/projects/edit_settings_spec.rb
@@ -228,14 +228,22 @@ RSpec.describe "Projects", "editing settings", :js, :with_cuprite do
context "with edit_project permission only" do
let!(:custom_field) { create(:string_project_custom_field, projects: [project]) }
let(:foo_field) { FormFields::InputFormField.new custom_field }
+ let(:role) { Role.first }
+
+ it "does not show custom fields" do
+ role.update(permissions: permissions - %i(edit_project_attributes))
+
+ visit project_settings_general_path(project)
+ expect(page).to have_no_content(custom_field.name)
+ end
it "does not allow saving custom fields" do
visit project_settings_general_path(project.id)
+ expect(page).to have_content(custom_field.name)
+
# Remove edit_project_attributes after loading the form
- role = Role.first
- role.permissions -= [:edit_project_attributes]
- role.save
+ role.update(permissions: permissions - %i(edit_project_attributes))
current_user.reload
foo_field.set_value "1234"
diff --git a/spec/features/projects/project_custom_fields/settings/mapping_spec.rb b/spec/features/projects/project_custom_fields/settings/mapping_spec.rb
index 940c4c02bb8..f7c82bc16fd 100644
--- a/spec/features/projects/project_custom_fields/settings/mapping_spec.rb
+++ b/spec/features/projects/project_custom_fields/settings/mapping_spec.rb
@@ -129,28 +129,6 @@ RSpec.describe "Projects custom fields mapping via project settings", :js, :with
end
end
- it "does show the activated custom fields in the project general settings page" do
- link_project_custom_field =
- create(:link_project_custom_field, name: "Link field",
- project_custom_field_section: section_for_input_fields)
-
- project.project_custom_fields << [
- boolean_project_custom_field,
- string_project_custom_field,
- link_project_custom_field,
- list_project_custom_field,
- multi_list_project_custom_field
- ]
-
- visit project_settings_general_path(project)
-
- expect(page).to have_content("Boolean field")
- expect(page).to have_content("String field")
- expect(page).to have_content("Link field")
- expect(page).to have_content("List field")
- expect(page).to have_content("Multi list field")
- end
-
it "shows all available project custom fields with their correct mapping state" do
visit project_settings_project_custom_fields_path(project)