Skip to content

Commit

Permalink
basic support for activity streams photos
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwell authored and danielgrippi committed Feb 21, 2012
1 parent 25cf776 commit 0ab8ef1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/template_picker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class TemplatePicker
rich_media
multi_photo
photo_backdrop
activity_streams_photo
status
}

Expand Down Expand Up @@ -41,6 +42,10 @@ def photo_backdrop?
post.photos.size == 1
end

def activity_streams_photo?
post.type == "ActivityStreams::Photo"
end

def status?
post.text?
end
Expand Down
8 changes: 8 additions & 0 deletions spec/lib/template_picker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,12 @@
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

0 comments on commit 0ab8ef1

Please sign in to comment.