Fix show more post in my activity mobile page. Close #4108

This commit is contained in:
movilla 2013-04-06 13:15:55 +02:00
parent 0149dbf9ad
commit bc87b501f2
6 changed files with 57 additions and 3 deletions

View file

@ -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

View file

@ -1196,3 +1196,8 @@ input#q.search {
text-align: right;
bottom: 25px;
}
.my_activity {
height: 16px;
width: 16px;
}

View file

@ -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

View file

@ -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"}

View file

@ -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"

View file

@ -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