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

Modify specs

Oliver Günther0672230b67e1
diff --git a/modules/meeting/spec/contracts/meeting_sections/create_contract_spec.rb b/modules/meeting/spec/contracts/meeting_sections/create_contract_spec.rb
index 5ac3b116c9d..52a37f38208 100644
--- a/modules/meeting/spec/contracts/meeting_sections/create_contract_spec.rb
+++ b/modules/meeting/spec/contracts/meeting_sections/create_contract_spec.rb
@@ -61,6 +61,14 @@ RSpec.describe MeetingSections::CreateContract do
it_behaves_like "contract is invalid", base: :error_unauthorized
end
+
+ context "when :title is empty" do
+ before do
+ section.title = ""
+ end
+
+ it_behaves_like "contract is invalid", title: :blank
+ end
end
context "without permission" do
diff --git a/modules/meeting/spec/features/structured_meetings/structured_meeting_crud_spec.rb b/modules/meeting/spec/features/structured_meetings/structured_meeting_crud_spec.rb
index 71b194955a8..2710025cf58 100644
--- a/modules/meeting/spec/features/structured_meetings/structured_meeting_crud_spec.rb
+++ b/modules/meeting/spec/features/structured_meetings/structured_meeting_crud_spec.rb
@@ -394,7 +394,7 @@ RSpec.describe "Structured meetings CRUD",
show_page.expect_agenda_item_in_section title: "First item", section: second_section
- first_section = MeetingSection.find_by!(title: "Untitled")
+ first_section = MeetingSection.find_by!(title: "")
# add an item to the first section explicitly
show_page.add_agenda_item_to_section(section: first_section) do
diff --git a/modules/meeting/spec/models/meeting_section_spec.rb b/modules/meeting/spec/models/meeting_section_spec.rb
index 3dd9ea35d41..fe796a05e8f 100644
--- a/modules/meeting/spec/models/meeting_section_spec.rb
+++ b/modules/meeting/spec/models/meeting_section_spec.rb
@@ -39,21 +39,11 @@ RSpec.describe MeetingSection do
describe "#title" do
let(:attributes) { { title: } }
- context "when title is missing" do
- let(:title) { nil }
-
- it "sets a default title" do
- expect(subject).to be_valid
- expect(subject.title).to eq I18n.t("meeting_section.default_title")
- end
- end
-
context "when title is blank" do
let(:title) { "" }
- it "sets a default title" do
+ it "is allowed" do
expect(subject).to be_valid
- expect(subject.title).to eq I18n.t("meeting_section.default_title")
end
end