about summary refs log tree commit diff
path: root/spec/lib
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-05-09 09:40:09 -0500
committermultiple creatures <dev@multiple-creature.party>2019-05-21 03:16:23 -0500
commite85b8af05183d1048adc4a39bc3d975af153463d (patch)
tree0cda58965ce9c8104cd65a6761678f2154bacd08 /spec/lib
parent66886d4367b64d6860c55ab6f8a57a31ed9b59de (diff)
Second round of Rspec fixes.
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/activitypub/activity/create_spec.rb3
-rw-r--r--spec/lib/activitypub/activity/delete_spec.rb2
-rw-r--r--spec/lib/activitypub/activity/move_spec.rb4
-rw-r--r--spec/lib/feed_manager_spec.rb6
4 files changed, 10 insertions, 5 deletions
diff --git a/spec/lib/activitypub/activity/create_spec.rb b/spec/lib/activitypub/activity/create_spec.rb
index 412609de4..d539a97ea 100644
--- a/spec/lib/activitypub/activity/create_spec.rb
+++ b/spec/lib/activitypub/activity/create_spec.rb
@@ -1,7 +1,7 @@
 require 'rails_helper'
 
 RSpec.describe ActivityPub::Activity::Create do
-  let(:sender) { Fabricate(:account, followers_url: 'http://example.com/followers', domain: 'example.com', uri: 'https://example.com/actor') }
+  let(:sender) { Fabricate(:account, followers_url: 'http://example.com/followers', domain: 'example.com', uri: 'https://example.com/actor', inbox_url: 'https://example.com/inbox') }
 
   let(:json) do
     {
@@ -18,6 +18,7 @@ RSpec.describe ActivityPub::Activity::Create do
 
     stub_request(:get, 'http://example.com/attachment.png').to_return(request_fixture('avatar.txt'))
     stub_request(:get, 'http://example.com/emoji.png').to_return(body: attachment_fixture('emojo.png'))
+    stub_request(:post, 'https://example.com/inbox')
   end
 
   describe '#perform' do
diff --git a/spec/lib/activitypub/activity/delete_spec.rb b/spec/lib/activitypub/activity/delete_spec.rb
index 37b93ecf7..c62962352 100644
--- a/spec/lib/activitypub/activity/delete_spec.rb
+++ b/spec/lib/activitypub/activity/delete_spec.rb
@@ -31,7 +31,7 @@ RSpec.describe ActivityPub::Activity::Delete do
     describe '#perform' do
       subject { described_class.new(json, sender) }
       let!(:reblogger) { Fabricate(:account) }
-      let!(:follower)  { Fabricate(:account, username: 'follower', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox') }
+      let!(:follower)  { Fabricate(:account, username: 'follower', domain: 'example.com', inbox_url: 'http://example.com/inbox') }
       let!(:reblog)    { Fabricate(:status, account: reblogger, reblog: status) }
 
       before do
diff --git a/spec/lib/activitypub/activity/move_spec.rb b/spec/lib/activitypub/activity/move_spec.rb
index 3574f273a..8b5121e9e 100644
--- a/spec/lib/activitypub/activity/move_spec.rb
+++ b/spec/lib/activitypub/activity/move_spec.rb
@@ -8,8 +8,8 @@ RSpec.describe ActivityPub::Activity::Move do
   before do
     follower.follow!(old_account)
 
-    old_account.update!(uri: 'https://example.org/alice', domain: 'example.org', protocol: :activitypub, inbox_url: 'https://example.org/inbox')
-    new_account.update!(uri: 'https://example.com/alice', domain: 'example.com', protocol: :activitypub, inbox_url: 'https://example.com/inbox', also_known_as: [old_account.uri])
+    old_account.update!(uri: 'https://example.org/alice', domain: 'example.org', inbox_url: 'https://example.org/inbox')
+    new_account.update!(uri: 'https://example.com/alice', domain: 'example.com', inbox_url: 'https://example.com/inbox', also_known_as: [old_account.uri])
 
     stub_request(:post, 'https://example.org/inbox').to_return(status: 200)
     stub_request(:post, 'https://example.com/inbox').to_return(status: 200)
diff --git a/spec/lib/feed_manager_spec.rb b/spec/lib/feed_manager_spec.rb
index 13850f807..9ef256764 100644
--- a/spec/lib/feed_manager_spec.rb
+++ b/spec/lib/feed_manager_spec.rb
@@ -22,9 +22,13 @@ RSpec.describe FeedManager do
 
   describe '#filter?' do
     let(:alice) { Fabricate(:account, username: 'alice') }
-    let(:bob)   { Fabricate(:account, username: 'bob', domain: 'example.com') }
+    let(:bob)   { Fabricate(:account, username: 'bob', domain: 'example.com', inbox_url: 'https://example.com/inbox') }
     let(:jeff)  { Fabricate(:account, username: 'jeff') }
 
+    before do
+      stub_request(:post, bob.inbox_url)
+    end
+
     context 'for home feed' do
       it 'returns false for followee\'s status' do
         status = Fabricate(:status, text: 'Hello world', account: alice)