diaspora/spec/lib/stream/person_spec.rb
Jonne Haß 0a124acdf0 Revert "fix regression from #3968"
Revert "Merge pull request #3968 from marpo60/limit_shareable_from_person_queries"

This reverts commit ddfc558a9b.
This reverts commit 30ed4b4e70, reversing
changes made to f50ce2cb1d.

limiting the fetch of the IDs breaks paginating, there's no quick way to fix that

I left the spec in for future use.
2013-02-16 23:48:10 +01:00

33 lines
853 B
Ruby

require 'spec_helper'
require Rails.root.join('spec', 'shared_behaviors', 'stream')
describe Stream::Person do
before do
@stream = Stream::Person.new(alice, bob.person, :max_time => Time.now, :order => 'updated_at')
end
describe 'shared behaviors' do
it_should_behave_like 'it is a stream'
end
it "returns the most recent posts" do
posts = []
fetched_posts = []
aspect = bob.aspects.first.id
Timecop.scale(600) do
16.times do |n|
posts << bob.post(:status_message, text: "hello#{n}", to: aspect)
posts << bob.post(:status_message, text: "hello#{n}", public: true)
end
fetched_posts = Stream::Person.new(alice, bob.person).stream_posts
end
posts = posts.reverse.slice(0..14)
fetched_posts = fetched_posts.slice(0..14)
fetched_posts.should == posts
end
end