Merge pull request #5002 from taratatach/4999-show-more-in-mobile-aspects-stream-redirects-to-my-activity

Load right stream with Show More on mobile
This commit is contained in:
Jason Robinson 2014-06-18 13:02:11 +03:00
commit 773340de67
2 changed files with 14 additions and 4 deletions

View file

@ -13,6 +13,8 @@ module StreamHelper
elsif controller.instance_of?(StreamsController) elsif controller.instance_of?(StreamsController)
if current_page?(:stream) if current_page?(:stream)
stream_path(:max_time => time_for_scroll(@stream)) stream_path(:max_time => time_for_scroll(@stream))
elsif current_page?(:aspects_stream)
aspects_stream_path(:max_time => time_for_scroll(@stream), :a_ids => session[:a_ids])
else else
activity_stream_path(:max_time => time_for_scroll(@stream)) activity_stream_path(:max_time => time_for_scroll(@stream))
end end

View file

@ -19,13 +19,21 @@ describe StreamHelper do
end end
it 'works for stream page when current page is stream' do it 'works for stream page when current page is stream' do
helper.stub(:current_page?).and_return(true) helper.stub(:current_page?).and_return(false)
helper.should_receive(:current_page?).with(:stream).and_return(true)
helper.stub(:controller).and_return(build_controller(StreamsController)) helper.stub(:controller).and_return(build_controller(StreamsController))
helper.next_page_path.should include stream_path helper.next_page_path.should include stream_path
end end
it 'works for activity page when current page is not stream' do it 'works for aspects page when current page is aspects' do
helper.stub("current_page?").and_return(false) helper.stub(:current_page?).and_return(false)
helper.should_receive(:current_page?).with(:aspects_stream).and_return(true)
helper.stub(:controller).and_return(build_controller(StreamsController))
helper.next_page_path.should include aspects_stream_path
end
it 'works for activity page when current page is not stream or aspects' do
helper.stub(:current_page?).and_return(false)
helper.stub(:controller).and_return(build_controller(StreamsController)) helper.stub(:controller).and_return(build_controller(StreamsController))
# binding.pry # binding.pry
helper.next_page_path.should include activity_stream_path helper.next_page_path.should include activity_stream_path