Fix 500 on mobile commented and liked streams

Fixes #7218, regression from #7036

closes #7219
This commit is contained in:
Steffen van Bergerem 2016-11-25 00:56:02 +01:00 committed by Benjamin Neff
parent ab0a769e9a
commit 9f88850faf
3 changed files with 19 additions and 0 deletions

View file

@ -19,6 +19,7 @@
* Fix visiblity on invitation modal when opening it from the stream [#7191](https://github.com/diaspora/diaspora/pull/7191)
* Add avatar fallback on tags page [#7198](https://github.com/diaspora/diaspora/pull/7198)
* Update notifications when changing the stream [#7199](https://github.com/diaspora/diaspora/pull/7199)
* Fix 500 on mobile commented and liked streams [#7219](https://github.com/diaspora/diaspora/pull/7219)
## Features
* Show spinner when loading comments in the stream [#7170](https://github.com/diaspora/diaspora/pull/7170)

View file

@ -30,6 +30,10 @@ module StreamHelper
aspects_stream_path(max_time: time_for_scroll(@stream), a_ids: session[:a_ids])
elsif current_page?(:public_stream)
public_stream_path(max_time: time_for_scroll(@stream))
elsif current_page?(:commented_stream)
commented_stream_path(max_time: time_for_scroll(@stream))
elsif current_page?(:liked_stream)
liked_stream_path(max_time: time_for_scroll(@stream))
elsif current_page?(:mentioned_stream)
mentioned_stream_path(max_time: time_for_scroll(@stream))
elsif current_page?(:followed_tags_stream)

View file

@ -41,6 +41,20 @@ describe StreamHelper, type: :helper do
expect(helper.next_page_path).to include activity_stream_path
end
it "works for commented page when current page is commented stream" do
allow(helper).to receive(:current_page?).and_return(false)
expect(helper).to receive(:current_page?).with(:commented_stream).and_return(true)
allow(helper).to receive(:controller).and_return(build_controller(StreamsController))
expect(helper.next_page_path).to include commented_stream_path
end
it "works for liked page when current page is liked stream" do
allow(helper).to receive(:current_page?).and_return(false)
expect(helper).to receive(:current_page?).with(:liked_stream).and_return(true)
allow(helper).to receive(:controller).and_return(build_controller(StreamsController))
expect(helper.next_page_path).to include liked_stream_path
end
it "works for mentioned page when current page is mentioned stream" do
allow(helper).to receive(:current_page?).and_return(false)
expect(helper).to receive(:current_page?).with(:mentioned_stream).and_return(true)