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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Add specs for MeetingAgendaItem#modifiable?
Dombi Attila44e5972e150b
diff --git a/modules/meeting/spec/models/meeting_agenda_item_spec.rb b/modules/meeting/spec/models/meeting_agenda_item_spec.rbindex 4553d5af7a6..b9cdd2b0cf0 100644--- a/modules/meeting/spec/models/meeting_agenda_item_spec.rb+++ b/modules/meeting/spec/models/meeting_agenda_item_spec.rb@@ -29,7 +29,8 @@require_relative "../spec_helper"RSpec.describe MeetingAgendaItem do- let(:meeting) { build_stubbed(:structured_meeting) }+ let(:meeting_attributes) { {} }+ let(:meeting) { build_stubbed(:structured_meeting, **meeting_attributes) }let(:attributes) { {} }let(:meeting_agenda_item) { described_class.new(meeting:, **attributes) }@@ -283,4 +284,42 @@ RSpec.describe MeetingAgendaItem doendendend++ describe '#modifiable?' do+ subject { meeting_agenda_item.modifiable? }++ let(:attributes) { { work_package_id: nil, item_type: :work_package } }++ context 'when meeting is closed' do+ let(:meeting_attributes) { { state: :closed } }++ it { is_expected.to be false }+ end++ context 'when the work package is not deleted' do+ before do+ allow(meeting_agenda_item).to receive(:deleted_work_package?).and_return(false)+ end++ it { is_expected.to be true }+ end++ context 'when work package is deleted' do+ before do+ allow(meeting_agenda_item).to receive(:deleted_work_package?).and_return(true)+ end++ context 'and the current value is not modified' do+ it { is_expected.to be true }+ end++ context 'and the current value is modified' do+ before do+ meeting_agenda_item.work_package_id = 1+ end++ it { is_expected.to be false }+ end+ end+ endend