about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2017-04-30 07:27:31 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-04-30 00:27:31 +0200
commit5135d609b774b177d3d3894b176a822d86b73d3c (patch)
treed0c2d75383518ab63fa80df617dd62bec25bba89 /spec
parentf48cb3eb170314cba1938522c0da44af21d47e83 (diff)
Use PostgreSQL inheritance for blocks and mutes (#2520)
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/atom_serializer_spec.rb4
-rw-r--r--spec/models/account_spec.rb6
-rw-r--r--spec/models/status_spec.rb6
3 files changed, 8 insertions, 8 deletions
diff --git a/spec/lib/atom_serializer_spec.rb b/spec/lib/atom_serializer_spec.rb
index cfca82a28..345285a7a 100644
--- a/spec/lib/atom_serializer_spec.rb
+++ b/spec/lib/atom_serializer_spec.rb
@@ -152,7 +152,7 @@ RSpec.describe AtomSerializer do
 
   describe '#block_salmon' do
     let(:xml) do
-      block = Fabricate(:block, account: author, target_account: receiver)
+      block = Fabricate(:block, account: author, target_account: receiver, block: true)
       xml   = AtomSerializer.render(AtomSerializer.new.block_salmon(block))
       block.destroy
       xml
@@ -171,7 +171,7 @@ RSpec.describe AtomSerializer do
 
   describe '#unblock_salmon' do
     let(:xml) do
-      block = Fabricate(:block, account: author, target_account: receiver)
+      block = Fabricate(:block, account: author, target_account: receiver, block: true)
       block.destroy
       xml = AtomSerializer.render(AtomSerializer.new.unblock_salmon(block))
       author.block!(receiver)
diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb
index 157db633a..b4481aaed 100644
--- a/spec/models/account_spec.rb
+++ b/spec/models/account_spec.rb
@@ -193,9 +193,9 @@ RSpec.describe Account, type: :model do
   describe '#excluded_from_timeline_account_ids' do
     it 'includes account ids of blockings, blocked_bys and mutes' do
       account = Fabricate(:account)
-      block = Fabricate(:block, account: account)
-      mute = Fabricate(:mute, account: account)
-      block_by = Fabricate(:block, target_account: account)
+      block = Fabricate(:block, account: account, block: true)
+      mute = Fabricate(:mute, account: account, block: false)
+      block_by = Fabricate(:block, target_account: account, block: true)
 
       results = account.excluded_from_timeline_account_ids
       expect(results.size).to eq 3
diff --git a/spec/models/status_spec.rb b/spec/models/status_spec.rb
index c553b052e..956b9b882 100644
--- a/spec/models/status_spec.rb
+++ b/spec/models/status_spec.rb
@@ -226,7 +226,7 @@ RSpec.describe Status, type: :model do
 
       it 'excludes statuses from accounts blocked by the account' do
         blocked = Fabricate(:account)
-        Fabricate(:block, account: @account, target_account: blocked)
+        Fabricate(:block, account: @account, target_account: blocked, block: true)
         blocked_status = Fabricate(:status, account: blocked)
 
         results = Status.as_public_timeline(@account)
@@ -235,7 +235,7 @@ RSpec.describe Status, type: :model do
 
       it 'excludes statuses from accounts who have blocked the account' do
         blocked = Fabricate(:account)
-        Fabricate(:block, account: blocked, target_account: @account)
+        Fabricate(:block, account: blocked, target_account: @account, block: true)
         blocked_status = Fabricate(:status, account: blocked)
 
         results = Status.as_public_timeline(@account)
@@ -244,7 +244,7 @@ RSpec.describe Status, type: :model do
 
       it 'excludes statuses from accounts muted by the account' do
         muted = Fabricate(:account)
-        Fabricate(:mute, account: @account, target_account: muted)
+        Fabricate(:mute, account: @account, target_account: muted, block: false)
         muted_status = Fabricate(:status, account: muted)
 
         results = Status.as_public_timeline(@account)