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

Override factory default when trying invalid journal

Oliver Günther3d78f7bc290b
diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb
index 0e8e36ffd51..0267cc393e7 100644
--- a/spec/models/notification_spec.rb
+++ b/spec/models/notification_spec.rb
@@ -33,9 +33,10 @@ describe Notification,
type: :model do
describe '.save' do
context 'for a non existing journal (e.g. because it has been deleted)' do
- let(:notification) { FactoryBot.build(:notification, journal_id: 55) }
+ let(:notification) { FactoryBot.build(:notification) }
it 'raises an error' do
+ notification.journal_id = 99999
expect { notification.save }
.to raise_error ActiveRecord::InvalidForeignKey
end