Skip to content

Commit

Permalink
feat[Op#59434]: add notification reason reminder
Browse files Browse the repository at this point in the history
  • Loading branch information
akabiru committed Nov 20, 2024
1 parent 78e2a7a commit bd3c339
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ class Notification < ApplicationRecord
responsible: 9,
date_alert_start_date: 10,
date_alert_due_date: 11,
shared: 12
shared: 12,
reminder: 13
}.freeze

enum reason: REASONS,
_prefix: true
enum :reason, REASONS, prefix: true

belongs_to :recipient, class_name: "User"
belongs_to :actor, class_name: "User"
Expand Down
24 changes: 24 additions & 0 deletions spec/models/notification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,30 @@
require "spec_helper"

RSpec.describe Notification do
describe "Enums" do
it do
expect(subject).to define_enum_for(:reason)
.with_values(
mentioned: 0,
assigned: 1,
watched: 2,
subscribed: 3,
commented: 4,
created: 5,
processed: 6,
prioritized: 7,
scheduled: 8,
responsible: 9,
date_alert_start_date: 10,
date_alert_due_date: 11,
shared: 12,
reminder: 13
)
.with_prefix
.backed_by_column_of_type(:integer)
end
end

describe ".save" do
context "for a non existing journal (e.g. because it has been deleted)" do
let(:notification) { build(:notification) }
Expand Down

0 comments on commit bd3c339

Please sign in to comment.