unambigousify community spotlight query in the multi stream, fix #3196

This commit is contained in:
Jonne Haß 2012-04-28 12:28:07 +02:00
parent 8d08f2604b
commit 008ed32e9e
2 changed files with 11 additions and 2 deletions

View file

@ -69,7 +69,7 @@ module EvilQuery
end
def community_spotlight_posts!
Post.all_public.where(:author_id => fetch_ids!(Person.community_spotlight, 'id'))
Post.all_public.where(:author_id => fetch_ids!(Person.community_spotlight, 'people.id'))
end
def ids!(query)

View file

@ -1,5 +1,14 @@
require 'spec_helper'
describe EvilQuery::MultiStream do
let(:evil_query) { EvilQuery::MultiStream.new(alice, 'created_at', Time.now-1.week, true) }
describe 'community_spotlight_posts!' do
it 'does not raise an error' do
expect { evil_query.community_spotlight_posts! }.to_not raise_error
end
end
end
describe EvilQuery::Participation do
before do
@status_message = Factory(:status_message, :author => bob.person)
@ -58,4 +67,4 @@ describe EvilQuery::Participation do
posts.map(&:id).should == [@status_messageE.id, @photoC.id, @status_messageA.id, @status_messageB.id]
end
end
end
end