From 0fa571d5e499acdf2a8a2331db617c558fd84e06 Mon Sep 17 00:00:00 2001 From: Faldrian Date: Thu, 18 Jun 2015 23:57:24 +0200 Subject: [PATCH 1/2] Fixed more-button wording when there are <15 posts --- .../shared/_stream_more_button.mobile.haml | 2 +- features/mobile/more-button.feature | 71 +++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 features/mobile/more-button.feature 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..a784fb089 --- /dev/null +++ b/features/mobile/more-button.feature @@ -0,0 +1,71 @@ +@javascript @mobile +Feature: posting from the mobile main page + 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 + And "bob@bob.bob" has a public post with text "post 1" + And "bob@bob.bob" has a public post with text "post 2" + And "bob@bob.bob" has a public post with text "post 3" + And "bob@bob.bob" has a public post with text "post 4" + And "bob@bob.bob" has a public post with text "post 5" + And "bob@bob.bob" has a public post with text "post 6" + And "bob@bob.bob" has a public post with text "post 7" + And "bob@bob.bob" has a public post with text "post 8" + And "bob@bob.bob" has a public post with text "post 9" + And "bob@bob.bob" has a public post with text "post 10" + And "bob@bob.bob" has a public post with text "post 11" + And "bob@bob.bob" has a public post with text "post 12" + And "bob@bob.bob" has a public post with text "post 13" + And "bob@bob.bob" has a public post with text "post 14" + And "bob@bob.bob" has a public post with text "post 15" + + 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 + And "bob@bob.bob" has a public post with text "post 1" + And "bob@bob.bob" has a public post with text "post 2" + And "bob@bob.bob" has a public post with text "post 3" + And "bob@bob.bob" has a public post with text "post 4" + And "bob@bob.bob" has a public post with text "post 5" + And "bob@bob.bob" has a public post with text "post 6" + And "bob@bob.bob" has a public post with text "post 7" + And "bob@bob.bob" has a public post with text "post 8" + And "bob@bob.bob" has a public post with text "post 9" + And "bob@bob.bob" has a public post with text "post 10" + And "bob@bob.bob" has a public post with text "post 11" + And "bob@bob.bob" has a public post with text "post 12" + And "bob@bob.bob" has a public post with text "post 13" + And "bob@bob.bob" has a public post with text "post 14" + And "bob@bob.bob" has a public post with text "post 15" + And "bob@bob.bob" has a public post with text "post 16" + + 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." From 12678bde537d16b83513335305d14a69088e86b0 Mon Sep 17 00:00:00 2001 From: Faldrian Date: Fri, 19 Jun 2015 12:26:14 +0200 Subject: [PATCH 2/2] Added cucumber step to add multiple posts in one step closes #6118 --- Changelog.md | 1 + features/mobile/more-button.feature | 34 +++--------------------- features/step_definitions/posts_steps.rb | 7 +++++ 3 files changed, 11 insertions(+), 31 deletions(-) diff --git a/Changelog.md b/Changelog.md index a61989dae..30bd4a812 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ ## 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/features/mobile/more-button.feature b/features/mobile/more-button.feature index a784fb089..a2a2816b9 100644 --- a/features/mobile/more-button.feature +++ b/features/mobile/more-button.feature @@ -1,5 +1,5 @@ @javascript @mobile -Feature: posting from the mobile main page +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 @@ -23,21 +23,8 @@ Feature: posting from the mobile main page 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" - And "bob@bob.bob" has a public post with text "post 2" - And "bob@bob.bob" has a public post with text "post 3" - And "bob@bob.bob" has a public post with text "post 4" - And "bob@bob.bob" has a public post with text "post 5" - And "bob@bob.bob" has a public post with text "post 6" - And "bob@bob.bob" has a public post with text "post 7" - And "bob@bob.bob" has a public post with text "post 8" - And "bob@bob.bob" has a public post with text "post 9" - And "bob@bob.bob" has a public post with text "post 10" - And "bob@bob.bob" has a public post with text "post 11" - And "bob@bob.bob" has a public post with text "post 12" - And "bob@bob.bob" has a public post with text "post 13" - And "bob@bob.bob" has a public post with text "post 14" - And "bob@bob.bob" has a public post with text "post 15" When I go to the stream page Then I should see "More" @@ -47,22 +34,7 @@ Feature: posting from the mobile main page Scenario: There are 15 +1 posts Given I am on the home page - And "bob@bob.bob" has a public post with text "post 1" - And "bob@bob.bob" has a public post with text "post 2" - And "bob@bob.bob" has a public post with text "post 3" - And "bob@bob.bob" has a public post with text "post 4" - And "bob@bob.bob" has a public post with text "post 5" - And "bob@bob.bob" has a public post with text "post 6" - And "bob@bob.bob" has a public post with text "post 7" - And "bob@bob.bob" has a public post with text "post 8" - And "bob@bob.bob" has a public post with text "post 9" - And "bob@bob.bob" has a public post with text "post 10" - And "bob@bob.bob" has a public post with text "post 11" - And "bob@bob.bob" has a public post with text "post 12" - And "bob@bob.bob" has a public post with text "post 13" - And "bob@bob.bob" has a public post with text "post 14" - And "bob@bob.bob" has a public post with text "post 15" - And "bob@bob.bob" has a public post with text "post 16" + Given there are 16 public posts from "bob@bob.bob" When I go to the stream page Then I should see "More" 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)