about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-12 17:28:15 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-12 17:30:15 +0100
commit720ff55262fec0abc630a613a4f3564b98b689dc (patch)
tree75a93b493dcec4cacd62f0ffcb55ad43891855c4 /app/services
parent446267d1bfaba0f596544186361553118615e942 (diff)
Adding more unit tests. Fixing Salmon slaps XML
Diffstat (limited to 'app/services')
-rw-r--r--app/services/favourite_service.rb8
-rw-r--r--app/services/fetch_atom_service.rb2
-rw-r--r--app/services/unfavourite_service.rb8
3 files changed, 6 insertions, 12 deletions
diff --git a/app/services/favourite_service.rb b/app/services/favourite_service.rb
index 11585250f..7038bc222 100644
--- a/app/services/favourite_service.rb
+++ b/app/services/favourite_service.rb
@@ -31,14 +31,10 @@ class FavouriteService < BaseService
         end
 
         object_type xml, :activity
-        verb xml, :favourite
+        verb xml, :favorite
 
         target(xml) do
-          author(xml) do
-            include_author xml, favourite.status.account
-          end
-
-          include_entry xml, favourite.status.stream_entry
+          include_target xml, favourite.status
         end
       end
     end.to_xml
diff --git a/app/services/fetch_atom_service.rb b/app/services/fetch_atom_service.rb
index 98ee1db84..f7e9c150a 100644
--- a/app/services/fetch_atom_service.rb
+++ b/app/services/fetch_atom_service.rb
@@ -2,6 +2,8 @@
 
 class FetchAtomService < BaseService
   def call(url)
+    return if url.blank?
+
     response = http_client.head(url)
 
     Rails.logger.debug "Remote status HEAD request returned code #{response.code}"
diff --git a/app/services/unfavourite_service.rb b/app/services/unfavourite_service.rb
index b79b8a938..7ad1778f6 100644
--- a/app/services/unfavourite_service.rb
+++ b/app/services/unfavourite_service.rb
@@ -22,14 +22,10 @@ class UnfavouriteService < BaseService
         end
 
         object_type xml, :activity
-        verb xml, :unfavourite
+        verb xml, :unfavorite
 
         target(xml) do
-          author(xml) do
-            include_author xml, favourite.status.account
-          end
-
-          include_entry xml, favourite.status.stream_entry
+          include_target xml, favourite.status
         end
       end
     end.to_xml