Skip to content

Commit

Permalink
unambigousify community spotlight query in the multi stream, fix dias…
Browse files Browse the repository at this point in the history
  • Loading branch information
jhass committed Apr 28, 2012
1 parent 8d08f26 commit 008ed32
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/evil_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def mentioned_posts
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)
Expand Down
11 changes: 10 additions & 1 deletion spec/lib/evil_query_spec.rb
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -58,4 +67,4 @@
posts.map(&:id).should == [@status_messageE.id, @photoC.id, @status_messageA.id, @status_messageB.id]
end
end
end
end

0 comments on commit 008ed32

Please sign in to comment.