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
|
||||
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue