From 6c374b51537126a2cba29f3eaf74faf1fc64ba96 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Mon, 6 May 2019 20:51:20 -0500 Subject: Drop OStatus support. Fix some of the Rspec tests. --- spec/services/fetch_remote_status_service_spec.rb | 55 +---------------------- 1 file changed, 1 insertion(+), 54 deletions(-) (limited to 'spec/services/fetch_remote_status_service_spec.rb') diff --git a/spec/services/fetch_remote_status_service_spec.rb b/spec/services/fetch_remote_status_service_spec.rb index f9db024b9..0e63cc9eb 100644 --- a/spec/services/fetch_remote_status_service_spec.rb +++ b/spec/services/fetch_remote_status_service_spec.rb @@ -16,9 +16,8 @@ RSpec.describe FetchRemoteStatusService, type: :service do end context 'protocol is :activitypub' do - subject { described_class.new.call(note[:id], prefetched_body, protocol) } + subject { described_class.new.call(note[:id], prefetched_body) } let(:prefetched_body) { Oj.dump(note) } - let(:protocol) { :activitypub } before do account.update(uri: ActivityPub::TagManager.instance.uri_for(account)) @@ -32,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 - - - tag:real.domain,2017-04-27:objectId=4487555:objectType=Status - 2017-04-27T13:49:25Z - 2017-04-27T13:49:25Z - http://activitystrea.ms/schema/1.0/note - http://activitystrea.ms/schema/1.0/post - - https://real.domain/users/tracer - http://activitystrea.ms/schema/1.0/person - https://real.domain/users/tracer - tracer - - Overwatch rocks - - XML - - expect(subject.call('https://fake.domain/foo', status_body, :ostatus)).to be_nil - end - - it 'does not create status with wrong id when id uses http format' do - status_body = <<-XML.squish - - - https://other-real.domain/statuses/123 - 2017-04-27T13:49:25Z - 2017-04-27T13:49:25Z - http://activitystrea.ms/schema/1.0/note - http://activitystrea.ms/schema/1.0/post - - https://real.domain/users/tracer - http://activitystrea.ms/schema/1.0/person - https://real.domain/users/tracer - tracer - - Overwatch rocks - - XML - - expect(subject.call('https://real.domain/statuses/456', status_body, :ostatus)).to be_nil - end - end end -- cgit