Permalink
Browse files

specs for same-second participations

  • Loading branch information...
1 parent c5573ab commit 1a8500419e64f8db290e65c3d69af7497b42628b @Raven24 Raven24 committed Apr 12, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 spec/lib/stream/activity_spec.rb
@@ -9,4 +9,24 @@
describe 'shared behaviors' do
it_should_behave_like 'it is a stream'
end
+
+ describe "participations with the same timestamp" do
+ before do
+ @status_msgZ = Factory(:status_message, :author => bob.person)
+ @status_msgY = Factory(:status_message, :author => bob.person)
+ @status_msgX = Factory(:activity_streams_photo, :author => bob.person)
+
+ Timecop.freeze do
+ alice.like!(@status_msgY)
+ alice.comment!(@status_msgZ, "party")
+ alice.like!(@status_msgX)
+ end
+ end
+
+ let(:posts) { Stream::Activity.new(alice).stream_posts }
+
+ it "returns the posts in the reverse order they were interacted with" do
+ posts.map(&:id).should == [@status_msgX.id, @status_msgZ.id, @status_msgY.id]
+ end
+ end
end

0 comments on commit 1a85004

Please sign in to comment.