Commit 9f88850f authored by Steffen van Bergerem's avatar Steffen van Bergerem Committed by Benjamin Neff

Fix 500 on mobile commented and liked streams

Fixes #7218, regression from #7036

closes #7219
parent ab0a769e
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment