From 0fa571d5e499acdf2a8a2331db617c558fd84e06 Mon Sep 17 00:00:00 2001 From: Faldrian Date: Thu, 18 Jun 2015 23:57:24 +0200 Subject: [PATCH] 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."