Skip to content
Snippets Groups Projects
Commit b048d1dd authored by Gonzalo Rodriguez's avatar Gonzalo Rodriguez
Browse files

When deleting an aspect from contacts page do not redirect to aspects page

parent 5b51dde1
No related branches found
No related tags found
No related merge requests found
......@@ -98,9 +98,12 @@ class AspectsController < ApplicationController
begin
@aspect.destroy
flash[:notice] = I18n.t 'aspects.destroy.success', :name => @aspect.name
redirect_to aspects_path
rescue ActiveRecord::StatementInvalid => e
flash[:error] = I18n.t 'aspects.destroy.failure', :name => @aspect.name
end
if request.referer.include?('contacts')
redirect_to contacts_path
else
redirect_to aspects_path
end
end
......
......@@ -19,6 +19,18 @@ Feature: User manages contacts
And I press "Create" in the modal window
Then I should see "losers" within "#aspect_nav"
Scenario: deleting an aspect from contacts index
Given I am signed in
And I have an aspect called "People"
When I am on the contacts page
And I follow "People"
And I follow "Edit People"
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 contacts 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment