From 0ab8ef1d083743cd6e0eaaaeb3b6de4b34013f19 Mon Sep 17 00:00:00 2001
From: Maxwell Salzberg <maxwell@joindiaspora.com>
Date: Fri, 17 Feb 2012 16:58:53 -0800
Subject: [PATCH] basic support for activity streams photos

---
 lib/template_picker.rb           | 5 +++++
 spec/lib/template_picker_spec.rb | 8 ++++++++
 2 files changed, 13 insertions(+)

diff --git a/lib/template_picker.rb b/lib/template_picker.rb
index 81080b5126..933ca458ef 100644
--- a/lib/template_picker.rb
+++ b/lib/template_picker.rb
@@ -6,6 +6,7 @@ class TemplatePicker
                   rich_media
                   multi_photo
                   photo_backdrop
+                  activity_streams_photo
                   status
                 }
 
@@ -41,6 +42,10 @@ class TemplatePicker
     post.photos.size == 1 
   end
 
+  def activity_streams_photo?
+    post.type == "ActivityStreams::Photo"
+  end
+
   def status?
     post.text?
   end
diff --git a/spec/lib/template_picker_spec.rb b/spec/lib/template_picker_spec.rb
index 38b0ff7f82..df9b511634 100644
--- a/spec/lib/template_picker_spec.rb
+++ b/spec/lib/template_picker_spec.rb
@@ -61,4 +61,12 @@ describe TemplatePicker do
       TemplatePicker.new(post).should be_status
     end
   end
+
+  describe '#activity_stream_photo' do
+    it 'is true if the post is of type activity_streams_photo' do
+      photo = stub(:type => "ActivityStreams::Photo")      
+      TemplatePicker.new(photo).should be_activity_streams_photo
+    end
+  end
+
 end
\ No newline at end of file
-- 
GitLab