add spec to ensure include_community_spotlight? is correctly passed into EvilQuery::MultiStream.new
This commit is contained in:
parent
0fedca33e3
commit
894af48579
1 changed files with 12 additions and 1 deletions
|
|
@ -3,13 +3,24 @@ require Rails.root.join('spec', 'shared_behaviors', 'stream')
|
||||||
|
|
||||||
describe Stream::Multi do
|
describe Stream::Multi do
|
||||||
before do
|
before do
|
||||||
@stream = Stream::Multi.new(alice, :max_time => Time.now, :order => 'updated_at')
|
@stream = Stream::Multi.new(alice, :max_time => @time, :order => 'updated_at')
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'shared behaviors' do
|
describe 'shared behaviors' do
|
||||||
it_should_behave_like 'it is a stream'
|
it_should_behave_like 'it is a stream'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#posts" do
|
||||||
|
it "calls EvilQuery::MultiStream with correct parameters" do
|
||||||
|
::EvilQuery::MultiStream.should_receive(:new)
|
||||||
|
.with(alice, 'updated_at', @stream.max_time,
|
||||||
|
AppConfig.settings.community_spotlight.enable? &&
|
||||||
|
alice.show_community_spotlight_in_stream?)
|
||||||
|
.and_return(mock.tap { |m| m.stub!(:make_relation!)})
|
||||||
|
@stream.posts
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe '#publisher_opts' do
|
describe '#publisher_opts' do
|
||||||
it 'prefills, sets public, and autoexpands if welcome? is set' do
|
it 'prefills, sets public, and autoexpands if welcome? is set' do
|
||||||
prefill_text = "sup?"
|
prefill_text = "sup?"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue