From da2ef4d676ff71e6ab3edf8d1a7cee8bf6b6d353 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 20 Nov 2016 00:33:02 +0100 Subject: Adding unified streamable notifications --- spec/models/notification_spec.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 spec/models/notification_spec.rb (limited to 'spec/models/notification_spec.rb') diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb new file mode 100644 index 000000000..97e8095cd --- /dev/null +++ b/spec/models/notification_spec.rb @@ -0,0 +1,29 @@ +require 'rails_helper' + +RSpec.describe Notification, type: :model do + describe '#from_account' do + pending + end + + describe '#type' do + it 'returns :reblog for a Status' do + notification = Notification.new(activity: Status.new) + expect(notification.type).to eq :reblog + end + + it 'returns :mention for a Mention' do + notification = Notification.new(activity: Mention.new) + expect(notification.type).to eq :mention + end + + it 'returns :favourite for a Favourite' do + notification = Notification.new(activity: Favourite.new) + expect(notification.type).to eq :favourite + end + + it 'returns :follow for a Follow' do + notification = Notification.new(activity: Follow.new) + expect(notification.type).to eq :follow + end + end +end -- cgit