Chore: FCM Notification Improvements (#957)

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
Sojan Jose
2020-06-15 13:36:56 +05:30
committed by GitHub
parent 667e3abbe1
commit b0bbd757b5
6 changed files with 71 additions and 9 deletions

View File

@@ -0,0 +1,21 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Notification do
context 'with associations' do
it { is_expected.to belong_to(:account) }
it { is_expected.to belong_to(:user) }
end
context 'with default order by' do
it 'sort by primary id desc' do
notification1 = create(:notification)
create(:notification)
notification3 = create(:notification)
expect(described_class.all.first).to eq notification3
expect(described_class.all.last).to eq notification1
end
end
end