diff --git a/lib/evil_query.rb b/lib/evil_query.rb index 113890c3b453d784234f1f6d9f5cefdf73c33d00..0753b0e0c5248bee9c547fb3008dffd45177ca6e 100644 --- a/lib/evil_query.rb +++ b/lib/evil_query.rb @@ -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) diff --git a/spec/lib/evil_query_spec.rb b/spec/lib/evil_query_spec.rb index 68cd11199514ab0da58e6878140008c8fac0fa32..05446e73003ca9652caab5308325d56c6050a405 100644 --- a/spec/lib/evil_query_spec.rb +++ b/spec/lib/evil_query_spec.rb @@ -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 \ No newline at end of file +end