New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed more-button wording when there are <15 posts #6118

Closed
wants to merge 2 commits into
base: develop
from

Conversation

Projects
None yet
4 participants
@Faldrian
Copy link
Contributor

Faldrian commented Jun 18, 2015

Added the scenario where there are <15 posts and the user should see "You have reached the end of the stream.".

"More" is only shown when there are 15 (maximum posts on a page) or more (we won't know, since the amount of items is limited by 15) posts. This can lead to one page showing 15 posts and the "More"-Button and when the button is clicked the next page presents a "You have reached the end of the stream."-Message.
Technically correct and without additional data from the database / an extra query I don't think this could get more convenient.

This fixes #6093

@@ -0,0 +1,71 @@
@javascript @mobile
Feature: posting from the mobile main page

This comment has been minimized.

@svbergerem

svbergerem Jun 19, 2015

Member

I think you forgot to change this line. ;-)

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"

This comment has been minimized.

@svbergerem

svbergerem Jun 19, 2015

Member

I think this should be a new step definition. You can find a similar one here https://github.com/Faldrian/diaspora/blob/6093-fix-mobile-pagination-wording/features/step_definitions/user_steps.rb#L102.

This one could be

Given /^(\d) public posts from "([^\"]*)"$/ do |n_posts, username|

This comment has been minimized.

@Faldrian

Faldrian Jun 19, 2015

Contributor

Okay, will do. In the past I had added a step and got the comment that there is already a step doing what I wanted, so this time I wanted to do as much as possible with existing steps.

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.to_s, :public => true, :to => user.aspect_ids)

This comment has been minimized.

@houndci-bot

houndci-bot Jun 19, 2015

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@Faldrian Faldrian force-pushed the Faldrian:6093-fix-mobile-pagination-wording branch from 1b9e04c to f0aadba Jun 19, 2015

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)

This comment has been minimized.

@svbergerem

svbergerem Jun 19, 2015

Member

I don't know why hound isn't complaining here but I think that you should use the new ruby hash syntax instead.

This comment has been minimized.

@Faldrian

Faldrian Jun 19, 2015

Contributor

what syntax? I looked for how to evaluate a variable inside a string and found this. How to do it "right"?

This comment has been minimized.

@jhass

jhass Jun 19, 2015

Member

Steffen is referring to the shorter syntax for hashes with Symbol keys introduced with Ruby 1.9: user.post(:status_message, text: "post nr. #{n}", public: true, to: user.aspect_ids)

@Faldrian Faldrian force-pushed the Faldrian:6093-fix-mobile-pagination-wording branch from f0aadba to 4f5af12 Jun 19, 2015

@Faldrian Faldrian force-pushed the Faldrian:6093-fix-mobile-pagination-wording branch from 4f5af12 to cac802d Jun 19, 2015

@Faldrian

This comment has been minimized.

Copy link
Contributor

Faldrian commented Jun 19, 2015

travis is stuck somewhere again

@svbergerem svbergerem added this to the 0.5.2.0 milestone Jun 19, 2015

@svbergerem

This comment has been minimized.

Copy link
Member

svbergerem commented Jun 19, 2015

Thank you. :)

@ghost

This comment has been minimized.

Copy link

ghost commented Jun 19, 2015

Great work @Faldrian - thanks man! :)

@Faldrian Faldrian deleted the Faldrian:6093-fix-mobile-pagination-wording branch Jun 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment