about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2021-05-07 19:32:58 +0200
committerGitHub <noreply@github.com>2021-05-07 19:32:58 +0200
commit1294f9ee4fab176bdc3989d667eed43f57baad5a (patch)
tree9f497d7994f87c97ad65f2bfe1aa62b594fed092 /spec
parentd8e0c8a89e1f1dd1c4ce1513deaeb3c85c6e4a42 (diff)
Remove PubSubHubbub-related columns from accounts table (#16170)
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/relationships_controller_spec.rb6
-rw-r--r--spec/services/authorize_follow_service_spec.rb18
-rw-r--r--spec/services/batched_remove_status_service_spec.rb2
-rw-r--r--spec/services/block_service_spec.rb13
-rw-r--r--spec/services/favourite_service_spec.rb14
-rw-r--r--spec/services/fetch_remote_status_service_spec.rb52
-rw-r--r--spec/services/process_mentions_service_spec.rb31
-rw-r--r--spec/services/reblog_service_spec.rb16
-rw-r--r--spec/services/reject_follow_service_spec.rb18
-rw-r--r--spec/services/remove_status_service_spec.rb2
-rw-r--r--spec/services/unblock_service_spec.rb14
-rw-r--r--spec/services/unfollow_service_spec.rb14
12 files changed, 3 insertions, 197 deletions
diff --git a/spec/controllers/relationships_controller_spec.rb b/spec/controllers/relationships_controller_spec.rb
index 16e255afe..2056a2ac2 100644
--- a/spec/controllers/relationships_controller_spec.rb
+++ b/spec/controllers/relationships_controller_spec.rb
@@ -36,11 +36,7 @@ describe RelationshipsController do
   end
 
   describe 'PATCH #update' do
-    let(:poopfeast) { Fabricate(:account, username: 'poopfeast', domain: 'example.com', salmon_url: 'http://example.com/salmon') }
-
-    before do
-      stub_request(:post, 'http://example.com/salmon').to_return(status: 200)
-    end
+    let(:poopfeast) { Fabricate(:account, username: 'poopfeast', domain: 'example.com') }
 
     shared_examples 'redirects back to followers page' do
       it 'redirects back to followers page' do
diff --git a/spec/services/authorize_follow_service_spec.rb b/spec/services/authorize_follow_service_spec.rb
index ce56d57a6..8e5d8fb03 100644
--- a/spec/services/authorize_follow_service_spec.rb
+++ b/spec/services/authorize_follow_service_spec.rb
@@ -22,24 +22,6 @@ RSpec.describe AuthorizeFollowService, type: :service do
     end
   end
 
-  describe 'remote OStatus' do
-    let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', domain: 'example.com', salmon_url: 'http://salmon.example.com')).account }
-
-    before do
-      FollowRequest.create(account: bob, target_account: sender)
-      stub_request(:post, "http://salmon.example.com/").to_return(:status => 200, :body => "", :headers => {})
-      subject.call(bob, sender)
-    end
-
-    it 'removes follow request' do
-      expect(bob.requested?(sender)).to be false
-    end
-
-    it 'creates follow relation' do
-      expect(bob.following?(sender)).to be true
-    end
-  end
-
   describe 'remote ActivityPub' do
     let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', domain: 'example.com', protocol: :activitypub, inbox_url: 'http://example.com/inbox')).account }
 
diff --git a/spec/services/batched_remove_status_service_spec.rb b/spec/services/batched_remove_status_service_spec.rb
index c1f54a6fd..4203952c6 100644
--- a/spec/services/batched_remove_status_service_spec.rb
+++ b/spec/services/batched_remove_status_service_spec.rb
@@ -4,7 +4,7 @@ RSpec.describe BatchedRemoveStatusService, type: :service do
   subject { BatchedRemoveStatusService.new }
 
   let!(:alice)  { Fabricate(:account) }
-  let!(:bob)    { Fabricate(:account, username: 'bob', domain: 'example.com', salmon_url: 'http://example.com/salmon') }
+  let!(:bob)    { Fabricate(:account, username: 'bob', domain: 'example.com') }
   let!(:jeff)   { Fabricate(:user).account }
   let!(:hank)   { Fabricate(:account, username: 'hank', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox') }
 
diff --git a/spec/services/block_service_spec.rb b/spec/services/block_service_spec.rb
index de20dd026..3714f09e9 100644
--- a/spec/services/block_service_spec.rb
+++ b/spec/services/block_service_spec.rb
@@ -17,19 +17,6 @@ RSpec.describe BlockService, type: :service do
     end
   end
 
-  describe 'remote OStatus' do
-    let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', domain: 'example.com', salmon_url: 'http://salmon.example.com')).account }
-
-    before do
-      stub_request(:post, "http://salmon.example.com/").to_return(:status => 200, :body => "", :headers => {})
-      subject.call(sender, bob)
-    end
-
-    it 'creates a blocking relation' do
-      expect(sender.blocking?(bob)).to be true
-    end
-  end
-
   describe 'remote ActivityPub' do
     let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox')).account }
 
diff --git a/spec/services/favourite_service_spec.rb b/spec/services/favourite_service_spec.rb
index 4c29ea77b..fc7f58eb4 100644
--- a/spec/services/favourite_service_spec.rb
+++ b/spec/services/favourite_service_spec.rb
@@ -18,20 +18,6 @@ RSpec.describe FavouriteService, type: :service do
     end
   end
 
-  describe 'remote OStatus' do
-    let(:bob)    { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', protocol: :ostatus, domain: 'example.com', salmon_url: 'http://salmon.example.com')).account }
-    let(:status) { Fabricate(:status, account: bob, uri: 'tag:example.com:blahblah') }
-
-    before do
-      stub_request(:post, "http://salmon.example.com/").to_return(:status => 200, :body => "", :headers => {})
-      subject.call(sender, status)
-    end
-
-    it 'creates a favourite' do
-      expect(status.favourites.first).to_not be_nil
-    end
-  end
-
   describe 'remote ActivityPub' do
     let(:bob)    { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, protocol: :activitypub, username: 'bob', domain: 'example.com', inbox_url: 'http://example.com/inbox')).account }
     let(:status) { Fabricate(:status, account: bob) }
diff --git a/spec/services/fetch_remote_status_service_spec.rb b/spec/services/fetch_remote_status_service_spec.rb
index 1c4b4fee2..0e63cc9eb 100644
--- a/spec/services/fetch_remote_status_service_spec.rb
+++ b/spec/services/fetch_remote_status_service_spec.rb
@@ -31,56 +31,4 @@ RSpec.describe FetchRemoteStatusService, type: :service do
       expect(status.text).to eq 'Lorem ipsum'
     end
   end
-
-  context 'protocol is :ostatus' do
-    subject { described_class.new }
-
-    before do
-      Fabricate(:account, username: 'tracer', domain: 'real.domain', remote_url: 'https://real.domain/users/tracer')
-    end
-
-    it 'does not create status with author at different domain' do
-      status_body = <<-XML.squish
-        <?xml version="1.0"?>
-        <entry xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:media="http://purl.org/syndication/atommedia" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:mastodon="http://mastodon.social/schema/1.0">
-          <id>tag:real.domain,2017-04-27:objectId=4487555:objectType=Status</id>
-          <published>2017-04-27T13:49:25Z</published>
-          <updated>2017-04-27T13:49:25Z</updated>
-          <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
-          <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
-          <author>
-            <id>https://real.domain/users/tracer</id>
-            <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
-            <uri>https://real.domain/users/tracer</uri>
-            <name>tracer</name>
-          </author>
-          <content type="html">Overwatch rocks</content>
-        </entry>
-      XML
-
-      expect(subject.call('https://fake.domain/foo', status_body)).to be_nil
-    end
-
-    it 'does not create status with wrong id when id uses http format' do
-      status_body = <<-XML.squish
-        <?xml version="1.0"?>
-        <entry xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:media="http://purl.org/syndication/atommedia" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:mastodon="http://mastodon.social/schema/1.0">
-          <id>https://other-real.domain/statuses/123</id>
-          <published>2017-04-27T13:49:25Z</published>
-          <updated>2017-04-27T13:49:25Z</updated>
-          <activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
-          <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
-          <author>
-            <id>https://real.domain/users/tracer</id>
-            <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
-            <uri>https://real.domain/users/tracer</uri>
-            <name>tracer</name>
-          </author>
-          <content type="html">Overwatch rocks</content>
-        </entry>
-      XML
-
-      expect(subject.call('https://real.domain/statuses/456', status_body)).to be_nil
-    end
-  end
 end
diff --git a/spec/services/process_mentions_service_spec.rb b/spec/services/process_mentions_service_spec.rb
index c30de8eeb..3b2f9d698 100644
--- a/spec/services/process_mentions_service_spec.rb
+++ b/spec/services/process_mentions_service_spec.rb
@@ -7,37 +7,6 @@ RSpec.describe ProcessMentionsService, type: :service do
 
   subject { ProcessMentionsService.new }
 
-  context 'OStatus with public toot' do
-    let(:remote_user) { Fabricate(:account, username: 'remote_user', protocol: :ostatus, domain: 'example.com', salmon_url: 'http://salmon.example.com') }
-
-    before do
-      stub_request(:post, remote_user.salmon_url)
-      subject.call(status)
-    end
-
-    it 'does not create a mention' do
-      expect(remote_user.mentions.where(status: status).count).to eq 0
-    end
-  end
-
-  context 'OStatus with private toot' do
-    let(:visibility)  { :private }
-    let(:remote_user) { Fabricate(:account, username: 'remote_user', protocol: :ostatus, domain: 'example.com', salmon_url: 'http://salmon.example.com') }
-
-    before do
-      stub_request(:post, remote_user.salmon_url)
-      subject.call(status)
-    end
-
-    it 'does not create a mention' do
-      expect(remote_user.mentions.where(status: status).count).to eq 0
-    end
-
-    it 'does not post to remote user\'s Salmon end point' do
-      expect(a_request(:post, remote_user.salmon_url)).to_not have_been_made
-    end
-  end
-
   context 'ActivityPub' do
     context do
       let(:remote_user) { Fabricate(:account, username: 'remote_user', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox') }
diff --git a/spec/services/reblog_service_spec.rb b/spec/services/reblog_service_spec.rb
index 58fb46f0f..e2077f282 100644
--- a/spec/services/reblog_service_spec.rb
+++ b/spec/services/reblog_service_spec.rb
@@ -32,22 +32,6 @@ RSpec.describe ReblogService, type: :service do
     end
   end
 
-  context 'OStatus' do
-    let(:bob)    { Fabricate(:account, username: 'bob', domain: 'example.com', salmon_url: 'http://salmon.example.com') }
-    let(:status) { Fabricate(:status, account: bob, uri: 'tag:example.com;something:something') }
-
-    subject { ReblogService.new }
-
-    before do
-      stub_request(:post, 'http://salmon.example.com')
-      subject.call(alice, status)
-    end
-
-    it 'creates a reblog' do
-      expect(status.reblogs.count).to eq 1
-    end
-  end
-
   context 'ActivityPub' do
     let(:bob)    { Fabricate(:account, username: 'bob', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox') }
     let(:status) { Fabricate(:status, account: bob) }
diff --git a/spec/services/reject_follow_service_spec.rb b/spec/services/reject_follow_service_spec.rb
index 1aec060db..732cb07f7 100644
--- a/spec/services/reject_follow_service_spec.rb
+++ b/spec/services/reject_follow_service_spec.rb
@@ -22,24 +22,6 @@ RSpec.describe RejectFollowService, type: :service do
     end
   end
 
-  describe 'remote OStatus' do
-    let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', domain: 'example.com', salmon_url: 'http://salmon.example.com')).account }
-
-    before do
-      FollowRequest.create(account: bob, target_account: sender)
-      stub_request(:post, "http://salmon.example.com/").to_return(:status => 200, :body => "", :headers => {})
-      subject.call(bob, sender)
-    end
-
-    it 'removes follow request' do
-      expect(bob.requested?(sender)).to be false
-    end
-
-    it 'does not create follow relation' do
-      expect(bob.following?(sender)).to be false
-    end
-  end
-
   describe 'remote ActivityPub' do
     let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', domain: 'example.com', protocol: :activitypub, inbox_url: 'http://example.com/inbox')).account }
 
diff --git a/spec/services/remove_status_service_spec.rb b/spec/services/remove_status_service_spec.rb
index 7ce75b2c7..21fb0cd35 100644
--- a/spec/services/remove_status_service_spec.rb
+++ b/spec/services/remove_status_service_spec.rb
@@ -4,7 +4,7 @@ RSpec.describe RemoveStatusService, type: :service do
   subject { RemoveStatusService.new }
 
   let!(:alice)  { Fabricate(:account, user: Fabricate(:user)) }
-  let!(:bob)    { Fabricate(:account, username: 'bob', domain: 'example.com', salmon_url: 'http://example.com/salmon') }
+  let!(:bob)    { Fabricate(:account, username: 'bob', domain: 'example.com') }
   let!(:jeff)   { Fabricate(:account) }
   let!(:hank)   { Fabricate(:account, username: 'hank', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox') }
   let!(:bill)   { Fabricate(:account, username: 'bill', protocol: :activitypub, domain: 'example2.com', inbox_url: 'http://example2.com/inbox') }
diff --git a/spec/services/unblock_service_spec.rb b/spec/services/unblock_service_spec.rb
index 6350c6834..c43ab24b0 100644
--- a/spec/services/unblock_service_spec.rb
+++ b/spec/services/unblock_service_spec.rb
@@ -18,20 +18,6 @@ RSpec.describe UnblockService, type: :service do
     end
   end
 
-  describe 'remote OStatus' do
-    let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', domain: 'example.com', salmon_url: 'http://salmon.example.com')).account }
-
-    before do
-      sender.block!(bob)
-      stub_request(:post, "http://salmon.example.com/").to_return(:status => 200, :body => "", :headers => {})
-      subject.call(sender, bob)
-    end
-
-    it 'destroys the blocking relation' do
-      expect(sender.blocking?(bob)).to be false
-    end
-  end
-
   describe 'remote ActivityPub' do
     let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox')).account }
 
diff --git a/spec/services/unfollow_service_spec.rb b/spec/services/unfollow_service_spec.rb
index 84b5dafbc..7f0b575e4 100644
--- a/spec/services/unfollow_service_spec.rb
+++ b/spec/services/unfollow_service_spec.rb
@@ -18,20 +18,6 @@ RSpec.describe UnfollowService, type: :service do
     end
   end
 
-  describe 'remote OStatus' do
-    let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', protocol: :ostatus, domain: 'example.com', salmon_url: 'http://salmon.example.com')).account }
-
-    before do
-      sender.follow!(bob)
-      stub_request(:post, "http://salmon.example.com/").to_return(:status => 200, :body => "", :headers => {})
-      subject.call(sender, bob)
-    end
-
-    it 'destroys the following relation' do
-      expect(sender.following?(bob)).to be false
-    end
-  end
-
   describe 'remote ActivityPub' do
     let(:bob) { Fabricate(:user, email: 'bob@example.com', account: Fabricate(:account, username: 'bob', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox')).account }