diff --git a/features/posts_from_main_page.feature b/features/posts_from_main_page.feature index d7f4e2a27..0fa02ac69 100644 --- a/features/posts_from_main_page.feature +++ b/features/posts_from_main_page.feature @@ -137,3 +137,17 @@ Feature: posting from the main page And I wait for the ajax to finish And I follow "Your Aspects" Then I should not see "I am eating a yogurt" + + Scenario: reject deletion one of my posts + When I expand the publisher + And I fill in "status_message_fake_text" with "I am eating a yogurt" + And I press "Share" + And I wait for the ajax to finish + + When I follow "Your Aspects" + And I hover over the ".stream_element" + And I preemptively reject the alert + And I click to delete the first post + Then I should see "I am eating a yogurt" + And I should see first post deletion link + And I should not see ajax loader on deletion link place diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index cbe75db81..4438de9b4 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -195,3 +195,11 @@ When /^I click on "([^"]*)" aspect edit icon$/ do |aspect_name| find(:xpath, "//a[@rel='facebox'][.//img[@title='Edit #{aspect_name}']]").click end end + +Then /^I should see first post deletion link$/ do + page.evaluate_script("$('.stream_element_delete').first().css('display')").should == "inline" +end + +Then /^I should not see ajax loader on deletion link place$/ do + page.evaluate_script("$('.hide_loader').first().css('display')").should == "none" +end