about summary refs log tree commit diff
path: root/spec/models/web/push_subscription_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/web/push_subscription_spec.rb')
-rw-r--r--spec/models/web/push_subscription_spec.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/spec/models/web/push_subscription_spec.rb b/spec/models/web/push_subscription_spec.rb
index bd5719593..e925e4c4c 100644
--- a/spec/models/web/push_subscription_spec.rb
+++ b/spec/models/web/push_subscription_spec.rb
@@ -1,6 +1,10 @@
+# frozen_string_literal: true
+
 require 'rails_helper'
 
 RSpec.describe Web::PushSubscription, type: :model do
+  subject { described_class.new(data: data) }
+
   let(:account) { Fabricate(:account) }
 
   let(:policy) { 'all' }
@@ -19,8 +23,6 @@ RSpec.describe Web::PushSubscription, type: :model do
     }
   end
 
-  subject { described_class.new(data: data) }
-
   describe '#pushable?' do
     let(:notification_type) { :mention }
     let(:notification) { Fabricate(:notification, account: account, type: notification_type) }
@@ -29,7 +31,7 @@ RSpec.describe Web::PushSubscription, type: :model do
       context "when notification is a #{type}" do
         let(:notification_type) { type }
 
-        it "returns boolean corresponding to alert setting" do
+        it 'returns boolean corresponding to alert setting' do
           expect(subject.pushable?(notification)).to eq data[:alerts][type]
         end
       end
@@ -39,7 +41,7 @@ RSpec.describe Web::PushSubscription, type: :model do
       let(:policy) { 'all' }
 
       it 'returns true' do
-        expect(subject.pushable?(notification)).to eq true
+        expect(subject.pushable?(notification)).to be true
       end
     end
 
@@ -47,7 +49,7 @@ RSpec.describe Web::PushSubscription, type: :model do
       let(:policy) { 'none' }
 
       it 'returns false' do
-        expect(subject.pushable?(notification)).to eq false
+        expect(subject.pushable?(notification)).to be false
       end
     end
 
@@ -60,13 +62,13 @@ RSpec.describe Web::PushSubscription, type: :model do
         end
 
         it 'returns true' do
-          expect(subject.pushable?(notification)).to eq true
+          expect(subject.pushable?(notification)).to be true
         end
       end
 
       context 'and notification is not from someone you follow' do
         it 'returns false' do
-          expect(subject.pushable?(notification)).to eq false
+          expect(subject.pushable?(notification)).to be false
         end
       end
     end
@@ -80,13 +82,13 @@ RSpec.describe Web::PushSubscription, type: :model do
         end
 
         it 'returns true' do
-          expect(subject.pushable?(notification)).to eq true
+          expect(subject.pushable?(notification)).to be true
         end
       end
 
       context 'and notification is not from someone who follows you' do
         it 'returns false' do
-          expect(subject.pushable?(notification)).to eq false
+          expect(subject.pushable?(notification)).to be false
         end
       end
     end