unambigousify community spotlight query in the multi stream, fix #3196
This commit is contained in:
parent
8d08f2604b
commit
008ed32e9e
2 changed files with 11 additions and 2 deletions
|
|
@ -69,7 +69,7 @@ module EvilQuery
|
||||||
end
|
end
|
||||||
|
|
||||||
def community_spotlight_posts!
|
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
|
end
|
||||||
|
|
||||||
def ids!(query)
|
def ids!(query)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,14 @@
|
||||||
require 'spec_helper'
|
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
|
describe EvilQuery::Participation do
|
||||||
before do
|
before do
|
||||||
@status_message = Factory(:status_message, :author => bob.person)
|
@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]
|
posts.map(&:id).should == [@status_messageE.id, @photoC.id, @status_messageA.id, @status_messageB.id]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue