* Add MVP of notification subscriptions * Add rate limiting for notification subscriptions * Show modal for logged out users on subscribe click * Add enter key functionality for checkbox * Add relationships for notification subscriptions * Add model test for notification subscription * Deprecated article mutes in favor of notification subscriptions * Deprecated comment mutes in favor of notification subscriptions * Move comment muting tests and logic over * Merge comment and article muting into subscriptions * Remove redundant check * Use database to check for rate limit instead of cache * Test for subscriptions handling notifications properly * Fix notification model spec for subscriptions * Fix tests for subscriptions * Remove rate limiting * Properly handle logged out users getting subscription status * Fix test for new pattern * Update reserved words * Add config column to notification subscriptions * Add logic for top level config and move tests * Test for top level subscribers getting notified * Fix logic mistake oops * Add index and refactor comment_user_ids
10 lines
351 B
Ruby
10 lines
351 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe NotificationSubscription, type: :model do
|
|
subject { create(:notification_subscription, user: user, notifiable: article) }
|
|
|
|
let(:user) { create(:user) }
|
|
let(:article) { create(:article, user: user) }
|
|
|
|
it { is_expected.to validate_uniqueness_of(:user_id).scoped_to(%i[notifiable_type notifiable_id]) }
|
|
end
|