Added cucumber step to add multiple posts in one step

closes #6118
This commit is contained in:
Faldrian 2015-06-19 12:26:14 +02:00 committed by Steffen van Bergerem
parent 0fa571d5e4
commit 12678bde53
3 changed files with 11 additions and 31 deletions

View file

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

View file

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

View file

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