Fix cucumber feature for deleting posts.
This commit is contained in:
parent
b0d98b9ce8
commit
5a23907143
2 changed files with 10 additions and 8 deletions
|
|
@ -13,14 +13,13 @@ Feature: posting
|
|||
And I expand the publisher
|
||||
When I fill in "status_message_fake_message" with "I am eating a yogurt"
|
||||
And I press "Share"
|
||||
|
||||
And I follow "Home"
|
||||
Then I should see "I am eating a yogurt" within ".stream_element"
|
||||
|
||||
Scenario: delete a post
|
||||
Given that I am a rock star
|
||||
And I have no open aspects saved
|
||||
Given I am signed in
|
||||
And I am signed in
|
||||
And I have an aspect called "Family"
|
||||
And I am on the home page
|
||||
And I expand the publisher
|
||||
|
|
@ -29,11 +28,10 @@ Feature: posting
|
|||
And I follow "Home"
|
||||
And I hover over the post
|
||||
And I preemptively confirm the alert
|
||||
And I press the first ".delete" within ".stream_element"
|
||||
And I click to delete the first post
|
||||
And I follow "Home"
|
||||
Then I should not see "I am eating a yogurt"
|
||||
|
||||
|
||||
Scenario Outline: post to one aspect
|
||||
Given that I am a rock star
|
||||
And I have no open aspects saved
|
||||
|
|
@ -45,11 +43,11 @@ Feature: posting
|
|||
And I wait for the ajax to finish
|
||||
And I expand the publisher
|
||||
And I fill in "status_message_fake_message" with "I am eating a yogurt"
|
||||
And I press "Share"
|
||||
And I press "Share"
|
||||
And I follow "Home"
|
||||
And I follow "<aspect>"
|
||||
Then I should <see> "I am eating a yogurt"
|
||||
|
||||
|
||||
Examples:
|
||||
| aspect | see |
|
||||
| PostTo | see |
|
||||
|
|
|
|||
|
|
@ -15,12 +15,16 @@ And /^I hover over the post$/ do
|
|||
page.execute_script('$(".stream_element").first().mouseover()')
|
||||
end
|
||||
|
||||
When /^I click to delete the first post$/ do
|
||||
page.execute_script('$(".stream_element").first().find(".delete").click()')
|
||||
end
|
||||
|
||||
And /^I preemptively confirm the alert$/ do
|
||||
a = page.evaluate_script("window.confirm = function() { return true; }")
|
||||
page.evaluate_script("window.confirm = function() { return true; }")
|
||||
end
|
||||
|
||||
And /^I preemptively reject the alert$/ do
|
||||
a = page.evaluate_script("window.confirm = function() { return false; }")
|
||||
page.evaluate_script("window.confirm = function() { return false; }")
|
||||
end
|
||||
|
||||
When /^(.*) in the modal window$/ do |action|
|
||||
|
|
|
|||
Loading…
Reference in a new issue