diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-05-11 18:12:42 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-05-11 18:12:42 +0200 |
commit | 45fce0e496727cd1579c630c22592638341f78c6 (patch) | |
tree | ff72ae5b3482e4df7885e1e5a38c982529fd11c4 /spec/models | |
parent | 34142ab29c33104793afe3199f102d84b83b9b57 (diff) | |
parent | 352bae8c3ef2aca41de4aacb85d5e036a1d2bace (diff) |
Merge branch 'master' into glitch-soc/merge
Conflicts: app/controllers/invites_controller.rb app/serializers/initial_state_serializer.rb config/locales/ko.yml
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/web/push_subscription_spec.rb | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/spec/models/web/push_subscription_spec.rb b/spec/models/web/push_subscription_spec.rb index 574da55ac..c6665611c 100644 --- a/spec/models/web/push_subscription_spec.rb +++ b/spec/models/web/push_subscription_spec.rb @@ -2,20 +2,8 @@ require 'rails_helper' RSpec.describe Web::PushSubscription, type: :model do let(:alerts) { { mention: true, reblog: false, follow: true, follow_request: false, favourite: true } } - let(:payload_no_alerts) { Web::PushSubscription.new(id: 1, endpoint: 'a', key_p256dh: 'c', key_auth: 'd').as_payload } - let(:payload_alerts) { Web::PushSubscription.new(id: 1, endpoint: 'a', key_p256dh: 'c', key_auth: 'd', data: { alerts: alerts }).as_payload } let(:push_subscription) { Web::PushSubscription.new(data: { alerts: alerts }) } - describe '#as_payload' do - it 'only returns id and endpoint' do - expect(payload_no_alerts.keys).to eq [:id, :endpoint] - end - - it 'returns alerts if set' do - expect(payload_alerts.keys).to eq [:id, :endpoint, :alerts] - end - end - describe '#pushable?' do it 'obeys alert settings' do expect(push_subscription.send(:pushable?, Notification.new(activity_type: 'Mention'))).to eq true |