diff --git a/Changelog.md b/Changelog.md index 667c8d3ad..8626c49d1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -115,6 +115,7 @@ by them self. * Remove unnecessary dotted CSS borders. [#2940](https://github.com/diaspora/diaspora/issues/2940) * Fix default image url in profiles table. [#3795](https://github.com/diaspora/diaspora/issues/3795) * Fix mobile buttons are only clickable when scrolled to the top. [#4102](https://github.com/diaspora/diaspora/issues/4102) +* My Activity mobile don't shows second page when click "more". [#4109](https://github.com/diaspora/diaspora/issues/4109) ## Features diff --git a/app/assets/stylesheets/mobile.css.scss b/app/assets/stylesheets/mobile.css.scss index 379939aee..c956a7ac0 100644 --- a/app/assets/stylesheets/mobile.css.scss +++ b/app/assets/stylesheets/mobile.css.scss @@ -1196,3 +1196,8 @@ input#q.search { text-align: right; bottom: 25px; } + +.my_activity { + height: 16px; + width: 16px; +} diff --git a/app/helpers/stream_helper.rb b/app/helpers/stream_helper.rb index fdfbac0aa..d0721b388 100644 --- a/app/helpers/stream_helper.rb +++ b/app/helpers/stream_helper.rb @@ -10,8 +10,12 @@ module StreamHelper local_or_remote_person_path(@person, :max_time => time_for_scroll(@stream)) elsif controller.instance_of?(PostsController) public_stream_path(:max_time => time_for_scroll(@stream)) - elsif controller.instance_of?(StreamsController) - stream_path(:max_time => time_for_scroll(@stream)) + elsif controller.instance_of?(StreamsController) + if current_page?(:stream) + stream_path(:max_time => time_for_scroll(@stream)) + else + activity_stream_path(:max_time => time_for_scroll(@stream)) + end else raise 'in order to use pagination for this new controller, update next_page_path in stream helper' end diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index b61f3e34a..4810a63b3 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -52,7 +52,7 @@ - if user_signed_in? #nav_badges - = link_to(image_tag('icons/my_activity.png', :height => 16, :width => 16), activity_stream_path, :class => "badge badge-inverse", :id => "my_activity_badge") + = link_to(image_tag('icons/my_activity.png', :class => 'my_activity'), activity_stream_path, :class => "badge badge-inverse", :id => "my_activity_badge") = link_to(image_tag('icons/notifications_grey.png', :height => 16, :width => 16, :id => 'notification-flag'), notifications_path, :class => "badge badge-inverse", :id => "notification_badge") - if current_user.unread_notifications.count > 0 .badge_count{:id => "notification"} diff --git a/features/activity_stream_mobile.feature b/features/activity_stream_mobile.feature new file mode 100644 index 000000000..003753d7c --- /dev/null +++ b/features/activity_stream_mobile.feature @@ -0,0 +1,23 @@ +@javascript +Feature: Viewing my activity on the steam mobile page + In order to navigate Diaspora* + As a mobile user + I want to view my actituty stream + + Background: + Given a user with username "alice" + And "alice@alice.alice" has a public post with text "Hello! i am #newhere" + When I sign in as "alice@alice.alice" + And I toggle the mobile view + + Scenario: Show my activity empty + When I click on selector "img.my_activity" + Then I should see "My Activity" + And I should not see "Hello! i am #newhere" + + Scenario: Show post on my activity + When I click on selector "a.image_link.like_action.inactive" + And I wait for the ajax to finish + And I click on selector "img.my_activity" + Then I should see "My Activity" + And I should see "Hello! i am #newhere" within ".ltr" diff --git a/spec/helpers/stream_helper_spec.rb b/spec/helpers/stream_helper_spec.rb index 93f5d8b9d..fc674eb4d 100644 --- a/spec/helpers/stream_helper_spec.rb +++ b/spec/helpers/stream_helper_spec.rb @@ -5,4 +5,25 @@ require 'spec_helper' describe StreamHelper do + describe "next_page_path" do + before do + @stream = Stream::Base.new(alice, :max_time => Time.now) + end + it 'works for public page' do + stub!(:controller).and_return(PostsController.new) + next_page_path.should include '/public' + end + + it 'works for stream page when current page is stream' do + self.stub!("current_page?").and_return(true) + stub!(:controller).and_return(StreamsController.new) + next_page_path.should include stream_path + end + + it 'works for activity page when current page is not stream' do + self.stub!("current_page?").and_return(false) + stub!(:controller).and_return(StreamsController.new) + next_page_path.should include activity_stream_path + end + end end