about summary refs log tree commit diff
path: root/spec/models
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-09-29 10:29:42 +0200
committerGitHub <noreply@github.com>2020-09-29 10:29:42 +0200
commit62e3f588dee75fc6a37457f8218630daad056cba (patch)
tree69439eebc4da7137206ee82e6ec3fa21cf8c7ed0 /spec/models
parent787d5d728923393f12421a480b3c7aee789a11fe (diff)
parentccfc2b6dce4bfda283bb6bc968a23fe4a76951d7 (diff)
Merge pull request #1430 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/account_deletion_request_spec.rb4
-rw-r--r--spec/models/concerns/account_interactions_spec.rb4
-rw-r--r--spec/models/follow_request_spec.rb2
-rw-r--r--spec/models/invite_spec.rb2
-rw-r--r--spec/models/webauthn_credentials_spec.rb4
5 files changed, 10 insertions, 6 deletions
diff --git a/spec/models/account_deletion_request_spec.rb b/spec/models/account_deletion_request_spec.rb
new file mode 100644
index 000000000..afaecbe22
--- /dev/null
+++ b/spec/models/account_deletion_request_spec.rb
@@ -0,0 +1,4 @@
+require 'rails_helper'
+
+RSpec.describe AccountDeletionRequest, type: :model do
+end
diff --git a/spec/models/concerns/account_interactions_spec.rb b/spec/models/concerns/account_interactions_spec.rb
index 36e346f14..48b44e58d 100644
--- a/spec/models/concerns/account_interactions_spec.rb
+++ b/spec/models/concerns/account_interactions_spec.rb
@@ -14,14 +14,14 @@ describe AccountInteractions do
     context 'account with Follow' do
       it 'returns { target_account_id => { reblogs: true } }' do
         Fabricate(:follow, account: account, target_account: target_account)
-        is_expected.to eq(target_account_id => { reblogs: true })
+        is_expected.to eq(target_account_id => { reblogs: true, notify: false })
       end
     end
 
     context 'account with Follow but with reblogs disabled' do
       it 'returns { target_account_id => { reblogs: false } }' do
         Fabricate(:follow, account: account, target_account: target_account, show_reblogs: false)
-        is_expected.to eq(target_account_id => { reblogs: false })
+        is_expected.to eq(target_account_id => { reblogs: false, notify: false })
       end
     end
 
diff --git a/spec/models/follow_request_spec.rb b/spec/models/follow_request_spec.rb
index 4b824c0db..7c8e121d9 100644
--- a/spec/models/follow_request_spec.rb
+++ b/spec/models/follow_request_spec.rb
@@ -7,7 +7,7 @@ RSpec.describe FollowRequest, type: :model do
     let(:target_account) { Fabricate(:account) }
 
     it 'calls Account#follow!, MergeWorker.perform_async, and #destroy!' do
-      expect(account).to        receive(:follow!).with(target_account, reblogs: true, uri: follow_request.uri)
+      expect(account).to        receive(:follow!).with(target_account, reblogs: true, notify: false, uri: follow_request.uri)
       expect(MergeWorker).to    receive(:perform_async).with(target_account.id, account.id)
       expect(follow_request).to receive(:destroy!)
       follow_request.authorize!
diff --git a/spec/models/invite_spec.rb b/spec/models/invite_spec.rb
index 30abfb86b..b0596c561 100644
--- a/spec/models/invite_spec.rb
+++ b/spec/models/invite_spec.rb
@@ -29,7 +29,7 @@ RSpec.describe Invite, type: :model do
 
     it 'returns false when invite creator has been disabled' do
       invite = Fabricate(:invite, max_uses: nil, expires_at: nil)
-      SuspendAccountService.new.call(invite.user.account)
+      invite.user.account.suspend!
       expect(invite.valid_for_use?).to be false
     end
   end
diff --git a/spec/models/webauthn_credentials_spec.rb b/spec/models/webauthn_credentials_spec.rb
index 9289c371e..a63ae6cd2 100644
--- a/spec/models/webauthn_credentials_spec.rb
+++ b/spec/models/webauthn_credentials_spec.rb
@@ -69,8 +69,8 @@ RSpec.describe WebauthnCredential, type: :model do
       expect(webauthn_credential).to model_have_error_on_field(:sign_count)
     end
 
-    it 'is invalid if sign_count is greater 2**32 - 1' do
-      webauthn_credential = Fabricate.build(:webauthn_credential, sign_count: 2**32)
+    it 'is invalid if sign_count is greater 2**63 - 1' do
+      webauthn_credential = Fabricate.build(:webauthn_credential, sign_count: 2**63)
 
       webauthn_credential.valid?