Changing cucumber steps to use tabular form where possible
This commit is contained in:
parent
1a30cd5a55
commit
8325882ea2
17 changed files with 98 additions and 38 deletions
|
|
@ -1,8 +1,10 @@
|
||||||
@javascript
|
@javascript
|
||||||
Feature: Blocking a user from the stream
|
Feature: Blocking a user from the stream
|
||||||
Background:
|
Background:
|
||||||
Given a user named "Bob Jones" with email "bob@bob.bob"
|
Given following users exist:
|
||||||
And a user named "Alice Smith" with email "alice@alice.alice"
|
| username | email |
|
||||||
|
| Bob Jones | bob@bob.bob |
|
||||||
|
| Alice Smith | alice@alice.alice |
|
||||||
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
||||||
And Alice has a post mentioning Bob
|
And Alice has a post mentioning Bob
|
||||||
And I sign in as "bob@bob.bob"
|
And I sign in as "bob@bob.bob"
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,10 @@ Feature: Close Account
|
||||||
And I should see a flash message containing "Invalid email or password"
|
And I should see a flash message containing "Invalid email or password"
|
||||||
|
|
||||||
Scenario: post display should not throw error when mention is removed for the user whose account is closed
|
Scenario: post display should not throw error when mention is removed for the user whose account is closed
|
||||||
Given a user named "Bob Jones" with email "bob@bob.bob"
|
Given following users exist:
|
||||||
And a user named "Alice Smith" with email "alice@alice.alice"
|
| username | email |
|
||||||
|
| Bob Jones | bob@bob.bob |
|
||||||
|
| Alice Smith | alice@alice.alice |
|
||||||
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
||||||
And Alice has a post mentioning Bob
|
And Alice has a post mentioning Bob
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@ Feature: commenting
|
||||||
I want to comment on her post
|
I want to comment on her post
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given a user named "Bob Jones" with email "bob@bob.bob"
|
Given following users exist:
|
||||||
And a user named "Alice Smith" with email "alice@alice.alice"
|
| username | email |
|
||||||
|
| Bob Jones | bob@bob.bob |
|
||||||
|
| Alice Smith | alice@alice.alice |
|
||||||
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
||||||
When "alice@alice.alice" has posted a status message with a photo
|
When "alice@alice.alice" has posted a status message with a photo
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,10 @@
|
||||||
Feature: following and being followed
|
Feature: following and being followed
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given a user with email "bob@bob.bob"
|
Given following users exist:
|
||||||
And a user with email "alice@alice.alice"
|
| email |
|
||||||
|
| bob@bob.bob |
|
||||||
|
| alice@alice.alice |
|
||||||
|
|
||||||
When I sign in as "bob@bob.bob"
|
When I sign in as "bob@bob.bob"
|
||||||
And I am on "alice@alice.alice"'s page
|
And I am on "alice@alice.alice"'s page
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@ Feature: posting
|
||||||
I want to see what humanity is saying about particular tags
|
I want to see what humanity is saying about particular tags
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given a user with username "bob"
|
Given following users exist:
|
||||||
And a user with username "alice"
|
| username |
|
||||||
|
| bob |
|
||||||
|
| alice |
|
||||||
|
|
||||||
When I sign in as "bob@bob.bob"
|
When I sign in as "bob@bob.bob"
|
||||||
And I post a status with the text "I am da #boss"
|
And I post a status with the text "I am da #boss"
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@ Feature: Mentions
|
||||||
To show people that this person exsists.
|
To show people that this person exsists.
|
||||||
|
|
||||||
Scenario: A user mentions another user and it displays correctly
|
Scenario: A user mentions another user and it displays correctly
|
||||||
Given a user named "Bob Jones" with email "bob@bob.bob"
|
Given following users exist:
|
||||||
And a user named "Alice Smith" with email "alice@alice.alice"
|
| username | email |
|
||||||
|
| Bob Jones | bob@bob.bob |
|
||||||
|
| Alice Smith | alice@alice.alice |
|
||||||
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
||||||
And Alice has a post mentioning Bob
|
And Alice has a post mentioning Bob
|
||||||
When I sign in as "alice@alice.alice"
|
When I sign in as "alice@alice.alice"
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,16 @@ Feature: mentioning a contact from their profile page
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given I am on the home page
|
Given I am on the home page
|
||||||
And a user with username "bob"
|
And following users exist:
|
||||||
And a user with username "alice"
|
| username |
|
||||||
|
| bob |
|
||||||
|
| alice |
|
||||||
|
|
||||||
When I sign in as "bob@bob.bob"
|
When I sign in as "bob@bob.bob"
|
||||||
And a user with username "bob" is connected with "alice"
|
And a user with username "bob" is connected with "alice"
|
||||||
And I have an aspect called "PostingTo"
|
And I have following aspects:
|
||||||
And I have an aspect called "NotPostingThingsHere"
|
| PostingTo |
|
||||||
|
| NotPostingThingsHere |
|
||||||
And I have user with username "alice" in an aspect called "PostingTo"
|
And I have user with username "alice" in an aspect called "PostingTo"
|
||||||
And I have user with username "alice" in an aspect called "NotPostingThingsHere"
|
And I have user with username "alice" in an aspect called "NotPostingThingsHere"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@
|
||||||
Feature: Not safe for work
|
Feature: Not safe for work
|
||||||
|
|
||||||
Scenario: Setting not safe for work
|
Scenario: Setting not safe for work
|
||||||
Given a user named "pr0n king" with email "tommy@pr0n.xxx"
|
Given following users exist:
|
||||||
|
| username | email |
|
||||||
|
| pr0n king | tommy@pr0n.xxx |
|
||||||
And I sign in as "tommy@pr0n.xxx"
|
And I sign in as "tommy@pr0n.xxx"
|
||||||
When I go to the edit profile page
|
When I go to the edit profile page
|
||||||
And I should see the "you are safe for work" message
|
And I should see the "you are safe for work" message
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@ Feature: Notifications
|
||||||
I want to get notifications
|
I want to get notifications
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given a user with email "bob@bob.bob"
|
Given That following users:
|
||||||
And a user with email "alice@alice.alice"
|
| email |
|
||||||
|
| bob@bob.bob |
|
||||||
|
| alice@alice.alice |
|
||||||
|
|
||||||
Scenario: someone shares with me
|
Scenario: someone shares with me
|
||||||
When I sign in as "bob@bob.bob"
|
When I sign in as "bob@bob.bob"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ Feature: oembed
|
||||||
I want the links in my posts be replaced by their oEmbed representation
|
I want the links in my posts be replaced by their oEmbed representation
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given a user named "Alice Smith" with email "alice@alice.alice"
|
Given following user exists:
|
||||||
|
| username | email |
|
||||||
|
| Alice Smith | alice@alice.alice |
|
||||||
And I have several oEmbed data in cache
|
And I have several oEmbed data in cache
|
||||||
When I sign in as "alice@alice.alice"
|
When I sign in as "alice@alice.alice"
|
||||||
And I am on the home page
|
And I am on the home page
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,15 @@ Feature: posting from the main page
|
||||||
I want to tell the world I am eating a yogurt
|
I want to tell the world I am eating a yogurt
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given a user with username "bob"
|
Given following users exist:
|
||||||
And a user with username "alice"
|
| username |
|
||||||
|
| bob |
|
||||||
|
| alice |
|
||||||
And I sign in as "bob@bob.bob"
|
And I sign in as "bob@bob.bob"
|
||||||
And a user with username "bob" is connected with "alice"
|
And a user with username "bob" is connected with "alice"
|
||||||
And I have an aspect called "PostingTo"
|
Given I have following aspects:
|
||||||
And I have an aspect called "NotPostingThingsHere"
|
| PostingTo |
|
||||||
|
| NotPostingThingsHere |
|
||||||
And I have user with username "alice" in an aspect called "PostingTo"
|
And I have user with username "alice" in an aspect called "PostingTo"
|
||||||
And I have user with username "alice" in an aspect called "NotPostingThingsHere"
|
And I have user with username "alice" in an aspect called "NotPostingThingsHere"
|
||||||
And I am on the home page
|
And I am on the home page
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@ Feature: public repost
|
||||||
I want to reshare my friend's post
|
I want to reshare my friend's post
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given a user named "Bob Jones" with email "bob@bob.bob"
|
Given following users exist:
|
||||||
And a user named "Alice Smith" with email "alice@alice.alice"
|
| username | email |
|
||||||
|
| Bob Jones | bob@bob.bob |
|
||||||
|
| Alice Smith | alice@alice.alice |
|
||||||
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
||||||
|
|
||||||
# should be covered in rspec, so testing that the post is added to
|
# should be covered in rspec, so testing that the post is added to
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ Feature: collapsing and expanding long posts
|
||||||
I want long posts to be collapsed and expand on click
|
I want long posts to be collapsed and expand on click
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given a user with username "bob"
|
Given that following user exists:
|
||||||
|
| username |
|
||||||
|
| bob |
|
||||||
And I sign in as "bob@bob.bob"
|
And I sign in as "bob@bob.bob"
|
||||||
And I am on the home page
|
And I am on the home page
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,20 +43,23 @@ Feature: new user registration
|
||||||
| user_username | $%&(/&%$&/=)(/ |
|
| user_username | $%&(/&%$&/=)(/ |
|
||||||
And I press "Continue"
|
And I press "Continue"
|
||||||
|
|
||||||
Then the "user_username" field should have a validation error
|
Then following fields should have validation errors:
|
||||||
And the "user_email" field should have a validation error
|
| user_username |
|
||||||
And the "user_password" field should have a validation error
|
| user_email |
|
||||||
|
| user_password |
|
||||||
|
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
| user_username | valid_user |
|
| user_username | valid_user |
|
||||||
| user_email | this is not a valid email $%&/()( |
|
| user_email | this is not a valid email $%&/()( |
|
||||||
And I press "Continue"
|
And I press "Continue"
|
||||||
|
|
||||||
Then the "user_email" field should have a validation error
|
Then following fields should have validation errors:
|
||||||
And the "user_password" field should have a validation error
|
| user_email |
|
||||||
|
| user_password |
|
||||||
|
|
||||||
When I fill in the following:
|
When I fill in the following:
|
||||||
| user_email | valid@email.com |
|
| user_email | valid@email.com |
|
||||||
| user_password | 1 |
|
| user_password | 1 |
|
||||||
And I press "Continue"
|
And I press "Continue"
|
||||||
Then the "user_password" field should have a validation error
|
Then following field should have validation error:
|
||||||
|
| user_password |
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,13 @@ Then /^the "([^"]*)" field should have a validation error$/ do |field|
|
||||||
find_field(field).has_xpath?(".//ancestor::div[contains(@class, 'control-group')]/div[contains(@class, 'field_with_errors')]")
|
find_field(field).has_xpath?(".//ancestor::div[contains(@class, 'control-group')]/div[contains(@class, 'field_with_errors')]")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Then /^following field[s]? should have validation error[s]?:$/ do |fields|
|
||||||
|
fields.raw.each do |field|
|
||||||
|
step %{the "#{field[0]}" field should have a validation error}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
And /^I expand the publisher$/ do
|
And /^I expand the publisher$/ do
|
||||||
click_publisher
|
click_publisher
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,20 @@ Given /^a nsfw user with email "([^\"]*)"$/ do |email|
|
||||||
user.profile.update_attributes(:nsfw => true)
|
user.profile.update_attributes(:nsfw => true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Given /^(?:|[tT]hat )?following user[s]?(?: exist[s]?)?:$/ do |table|
|
||||||
|
table.hashes.each do |hash|
|
||||||
|
if hash.has_key? "username" and hash.has_key? "email"
|
||||||
|
step %{a user named "#{hash['username']}" with email "#{hash['email']}"}
|
||||||
|
elsif hash.has_key? "username"
|
||||||
|
step %{a user with username "#{hash['username']}"}
|
||||||
|
elsif hash.has_key? "email"
|
||||||
|
step %{a user with email "#{hash['email']}"}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
Given /^I have been invited by an admin$/ do
|
Given /^I have been invited by an admin$/ do
|
||||||
admin = Factory(:user)
|
admin = Factory(:user)
|
||||||
admin.invitation_code
|
admin.invitation_code
|
||||||
|
|
@ -52,6 +66,12 @@ Given /^I have an aspect called "([^\"]*)"$/ do |aspect_name|
|
||||||
@me.reload
|
@me.reload
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Given /^I have following aspect[s]?:$/ do |fields|
|
||||||
|
fields.raw.each do |field|
|
||||||
|
step %{I have an aspect called "#{field[0]}"}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
When /^I have user with username "([^"]*)" in an aspect called "([^"]*)"$/ do |username, aspect|
|
When /^I have user with username "([^"]*)" in an aspect called "([^"]*)"$/ do |username, aspect|
|
||||||
user = User.find_by_username(username)
|
user = User.find_by_username(username)
|
||||||
contact = @me.reload.contact_for(user.person)
|
contact = @me.reload.contact_for(user.person)
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,10 @@ Feature: Unfollowing
|
||||||
I want to be able to stop following people
|
I want to be able to stop following people
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
Given a user with email "bob@bob.bob"
|
Given following users:
|
||||||
And a user with email "alice@alice.alice"
|
| email |
|
||||||
|
| bob@bob.bob |
|
||||||
|
| alice@alice.alice |
|
||||||
When I sign in as "bob@bob.bob"
|
When I sign in as "bob@bob.bob"
|
||||||
And I am on "alice@alice.alice"'s page
|
And I am on "alice@alice.alice"'s page
|
||||||
And I add the person to my "Besties" aspect
|
And I add the person to my "Besties" aspect
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue