diff --git a/Changelog.md b/Changelog.md index f81a2c947..0d7ecab02 100644 --- a/Changelog.md +++ b/Changelog.md @@ -52,6 +52,7 @@ bind to an UNIX socket at `unix:tmp/diaspora.sock`. Please change your local ## Bug fixes * Precompile facebox images [#6105](https://github.com/diaspora/diaspora/pull/6105) * Fix wrong closing a-tag [#6111](https://github.com/diaspora/diaspora/pull/6111) +* Fix mobile more-button wording when there are less than 15 posts [#6118](https://github.com/diaspora/diaspora/pull/6118) ## Features * Add configuration options for some debug logs [#6090](https://github.com/diaspora/diaspora/pull/6090) diff --git a/app/views/shared/_stream_more_button.mobile.haml b/app/views/shared/_stream_more_button.mobile.haml index 20f5f879a..2bcedd042 100644 --- a/app/views/shared/_stream_more_button.mobile.haml +++ b/app/views/shared/_stream_more_button.mobile.haml @@ -3,7 +3,7 @@ %a.more-link.paginate{:href => next_page_path} %h1 = t("more") --elsif params[:max_time].present? +-elsif params[:max_time].present? || @stream.stream_posts.length > 0 #pagination %div.no-more-posts %h2 diff --git a/features/mobile/more-button.feature b/features/mobile/more-button.feature new file mode 100644 index 000000000..a2a2816b9 --- /dev/null +++ b/features/mobile/more-button.feature @@ -0,0 +1,43 @@ +@javascript @mobile +Feature: using the more button on mobile stream + As a mobile user + I want to navigate the stream + And I want to test the text of the more-button in different environments + + Background: + Given a user with username "bob" + And I sign in as "bob@bob.bob" on the mobile website + + Scenario: There are no posts + Given I am on the home page + + When I go to the stream page + Then I should see "There are no posts yet." + + Scenario: There are <15 posts + Given I am on the home page + And "bob@bob.bob" has a public post with text "post 1" + + When I go to the stream page + Then I should see "You have reached the end of the stream." + + Scenario: There are 15 posts + Given I am on the home page + Given there are 15 public posts from "bob@bob.bob" + And "bob@bob.bob" has a public post with text "post 1" + + When I go to the stream page + Then I should see "More" + + When I click on selector ".more-link" + Then I should see "You have reached the end of the stream." + + Scenario: There are 15 +1 posts + Given I am on the home page + Given there are 16 public posts from "bob@bob.bob" + + When I go to the stream page + Then I should see "More" + + When I click on selector ".more-link" + Then I should see "You have reached the end of the stream." diff --git a/features/step_definitions/posts_steps.rb b/features/step_definitions/posts_steps.rb index 69c86f80b..10c04b8ab 100644 --- a/features/step_definitions/posts_steps.rb +++ b/features/step_definitions/posts_steps.rb @@ -27,6 +27,13 @@ Given /^"([^"]*)" has a public post with text "([^"]*)"$/ do |email, text| user.post(:status_message, :text => text, :public => true, :to => user.aspect_ids) end +Given /^there are (\d+) public posts from "([^"]*)"$/ do |n_posts, email| + user = User.find_by_email(email) + (1..n_posts.to_i).each do |n| + user.post(:status_message, text: "post nr. #{n}", public: true, to: user.aspect_ids) + end +end + Given /^"([^"]*)" has a non public post with text "([^"]*)"$/ do |email, text| user = User.find_by_email(email) user.post(:status_message, :text => text, :public => false, :to => user.aspect_ids)