Commit 5a239071 authored by Sarah Mei's avatar Sarah Mei

Fix cucumber feature for deleting posts.

parent b0d98b9c
......@@ -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|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment