When deleting an aspect from contacts page do not redirect to aspects page
This commit is contained in:
parent
5b51dde195
commit
b048d1dd54
2 changed files with 16 additions and 1 deletions
|
|
@ -98,9 +98,12 @@ class AspectsController < ApplicationController
|
||||||
begin
|
begin
|
||||||
@aspect.destroy
|
@aspect.destroy
|
||||||
flash[:notice] = I18n.t 'aspects.destroy.success', :name => @aspect.name
|
flash[:notice] = I18n.t 'aspects.destroy.success', :name => @aspect.name
|
||||||
redirect_to aspects_path
|
|
||||||
rescue ActiveRecord::StatementInvalid => e
|
rescue ActiveRecord::StatementInvalid => e
|
||||||
flash[:error] = I18n.t 'aspects.destroy.failure', :name => @aspect.name
|
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
|
redirect_to aspects_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,18 @@ Feature: User manages contacts
|
||||||
And I press "Create" in the modal window
|
And I press "Create" in the modal window
|
||||||
Then I should see "losers" within "#aspect_nav"
|
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
|
Scenario: Editing the aspect memberships of a contact from the aspect edit facebox
|
||||||
Given I am signed in
|
Given I am signed in
|
||||||
And I have 2 contacts
|
And I have 2 contacts
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue