diff --git a/features/manages_aspects.feature b/features/manages_aspects.feature index 6d64067ef..a307d49dd 100644 --- a/features/manages_aspects.feature +++ b/features/manages_aspects.feature @@ -31,6 +31,17 @@ Feature: User manages contacts Then I should be on the contacts page And I should not see "People" within "#aspect_nav" + Scenario: deleting an aspect from homepage + Given I am signed in + And I have an aspect called "People" + When I am on the home page + And I click on "People" aspect edit icon + And I wait for the ajax to finish + And I click ok in the confirm dialog to appear next + And I press "Delete" in the modal window + Then I should be on the aspects page + And I should not see "People" within "#aspect_nav" + Scenario: Editing the aspect memberships of a contact from the aspect edit facebox Given I am signed in And I have 2 contacts diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 01a7965a0..ffc71c8f4 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -215,3 +215,10 @@ When /^I resize my window to 800x600$/ do window.resizeTo(800,600); JS end + +When /^I click on "([^"]*)" aspect edit icon$/ do |aspect_name| + When %{I hover over the "ul.sub_nav > li:contains('#{aspect_name}')"} + within("#aspect_nav") do + find(:xpath, "//a[@rel='facebox'][.//img[@title='Edit #{aspect_name}']]").click + end +end