diff --git a/lib/stream/multi.rb b/lib/stream/multi.rb index c43d11023..c1ecd599d 100644 --- a/lib/stream/multi.rb +++ b/lib/stream/multi.rb @@ -49,7 +49,7 @@ class Stream::Multi < Stream::Base # @return [Symbol] def is_in?(sym, post) - if self.send("#{sym.to_s}_post_ids").find{|x| x == post.id} + if self.send("#{sym.to_s}_post_ids").find{|x| x.to_s == post.id.to_s} "#{sym.to_s}_stream".to_sym end end diff --git a/spec/lib/stream/multi_spec.rb b/spec/lib/stream/multi_spec.rb index b5bbcb9d5..21a81d4eb 100644 --- a/spec/lib/stream/multi_spec.rb +++ b/spec/lib/stream/multi_spec.rb @@ -6,7 +6,16 @@ describe Stream::Multi do @stream = Stream::Multi.new(Factory(:user), :max_time => Time.now, :order => 'updated_at') end + describe 'shared behaviors' do it_should_behave_like 'it is a stream' end + + describe '#is_in?' do + it 'handles when the cache returns strings' do + p = Factory(:status_message) + @stream.should_receive(:aspects_post_ids).and_return([p.id.to_s]) + @stream.send(:is_in?, :aspects, p).should be_true + end + end end