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
simplify spec for unsent_reminders_before
Ivan Kuchina4e05a01cc5d
diff --git a/spec/models/notifications/scopes/unsent_reminders_before_spec.rb b/spec/models/notifications/scopes/unsent_reminders_before_spec.rbindex c739b814ec4..6d72d260542 100644--- a/spec/models/notifications/scopes/unsent_reminders_before_spec.rb+++ b/spec/models/notifications/scopes/unsent_reminders_before_spec.rb@@ -39,7 +39,7 @@ RSpec.describe Notifications::Scopes::UnsentRemindersBefore doTime.currentend- let(:notification) do+ let!(:notification) docreate(:notification,recipient: notification_recipient,read_ian: notification_read_ian,@@ -51,50 +51,40 @@ RSpec.describe Notifications::Scopes::UnsentRemindersBefore dolet(:notification_created_at) { 10.minutes.ago }let(:notification_recipient) { recipient }- let!(:notifications) { notification }-- shared_examples_for "is empty" do- it "is empty" do- expect(scope)- .to be_empty- end- end-context "with a unread and not reminded notification that was created before the time and for the user" doit "returns the notification" do- expect(scope)- .to contain_exactly(notification)+ expect(scope).to contain_exactly(notification)endendcontext "with a unread and not reminded notification that was created after the time and for the user" dolet(:notification_created_at) { 10.minutes.from_now }- it_behaves_like "is empty"+ it { is_expected.to be_empty }endcontext "with a unread and not reminded notification that was created before the time and for different user" dolet(:notification_recipient) { create(:user) }- it_behaves_like "is empty"+ it { is_expected.to be_empty }endcontext "with a unread and not reminded notification created before the time and for the user" dolet(:notification_mail_reminder_sent) { nil }- it_behaves_like "is empty"+ it { is_expected.to be_empty }endcontext "with a unread but reminded notification created before the time and for the user" dolet(:notification_mail_reminder_sent) { true }- it_behaves_like "is empty"+ it { is_expected.to be_empty }endcontext "with a read notification that was created before the time" dolet(:notification_read_ian) { true }- it_behaves_like "is empty"+ it { is_expected.to be_empty }endendend