diff options
author | Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> | 2017-07-18 23:39:47 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-07-18 16:39:47 +0200 |
commit | 89b988cab5e4729bd80400a2b25ec2b790ebd18d (patch) | |
tree | 44d8596f508876c7ad17fa40c3212abfbe4b3c3c /spec/services | |
parent | 4d42a389540690b32886f2a38af1f86aee617d27 (diff) |
Introduce Ostatus name space (#4164)
* Wrap methods of ProcessFeedService::ProcessEntry in classes This is a change same with 425acecfdb15093a265b191120fb2d4e4c4135c4, except that it has the following changes: * Revert irrelevant change in find_or_create_conversation * Fix error handling for RemoteActivity * Introduce Ostatus name space
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/process_feed_service_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/services/process_feed_service_spec.rb b/spec/services/process_feed_service_spec.rb index d85ee3b56..5e34370ee 100644 --- a/spec/services/process_feed_service_spec.rb +++ b/spec/services/process_feed_service_spec.rb @@ -167,6 +167,46 @@ XML expect(created_statuses.first.reblog.text).to eq 'Overwatch rocks' end + it 'ignores reblogs if it failed to retreive reblogged statuses' do + stub_request(:head, 'https://overwatch.com/users/tracer/updates/1').to_return(status: 404) + + actor = Fabricate(:account, username: 'tracer', domain: 'overwatch.com') + + body = <<XML +<?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:overwatch.com,2017-04-27:objectId=4467137:objectType=Status</id> + <published>2017-04-27T13:49:25Z</published> + <updated>2017-04-27T13:49:25Z</updated> + <author> + <id>https://overwatch.com/users/tracer</id> + <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type> + <uri>https://overwatch.com/users/tracer</uri> + <name>tracer</name> + </author> + <activity:object-type>http://activitystrea.ms/schema/1.0/activity</activity:object-type> + <activity:verb>http://activitystrea.ms/schema/1.0/share</activity:verb> + <content type="html">Overwatch rocks</content> + <activity:object> + <id>tag:overwatch.com,2017-04-27:objectId=4467137:objectType=Status</id> + <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://overwatch.com/users/tracer</id> + <activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type> + <uri>https://overwatch.com/users/tracer</uri> + <name>tracer</name> + </author> + <content type="html">Overwatch rocks</content> + <link rel="alternate" type="text/html" href="https://overwatch.com/users/tracer/updates/1" /> + </activity:object> +XML + + created_statuses = subject.call(body, actor) + + expect(created_statuses).to eq [] + end + it 'ignores statuses with an out-of-order delete' do sender = Fabricate(:account, username: 'tracer', domain: 'overwatch.com') |