forgot to add
This commit is contained in:
parent
5eb487ed20
commit
4105f90aaa
2 changed files with 81 additions and 0 deletions
60
features/disconnects_users.feature
Normal file
60
features/disconnects_users.feature
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
@javascript
|
||||||
|
Feature: disconnecting users
|
||||||
|
In order to deal with life
|
||||||
|
As a User
|
||||||
|
I want to be able to disconnect from others
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given a user with email "bob@bob.bob"
|
||||||
|
And a user with email "alice@alice.alice"
|
||||||
|
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
|
||||||
|
When I sign in as "bob@bob.bob"
|
||||||
|
And I am on the aspects manage page
|
||||||
|
Then I should see 1 contact in "Besties"
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: remove contact from the contact show page
|
||||||
|
When I am on "alice@alice.alice"'s page
|
||||||
|
And I follow "edit aspect membership"
|
||||||
|
And I preemptively confirm the alert
|
||||||
|
And I follow "remove contact" in the modal window
|
||||||
|
|
||||||
|
And I wait for the ajax to finish
|
||||||
|
And I am on the aspects manage page
|
||||||
|
Then I should see no contacts in "Besties"
|
||||||
|
|
||||||
|
|
||||||
|
Scenario: cancel removing contact from the contact show page
|
||||||
|
When I am on "alice@alice.alice"'s page
|
||||||
|
And I follow "edit aspect membership"
|
||||||
|
And I preemptively reject the alert
|
||||||
|
And I follow "remove contact" in the modal window
|
||||||
|
|
||||||
|
And I wait for the ajax to finish
|
||||||
|
And I am on the aspects manage page
|
||||||
|
Then I should see 1 contact in "Besties"
|
||||||
|
|
||||||
|
Scenario: remove contact from the aspect edit page
|
||||||
|
When I go to the home page
|
||||||
|
And I follow "Besties" within "#aspect_listings"
|
||||||
|
|
||||||
|
And I wait for the ajax to finish
|
||||||
|
And I preemptively confirm the alert
|
||||||
|
And I press the first ".added" within "#facebox .contact_list ul > li:first-child"
|
||||||
|
|
||||||
|
And I wait for the ajax to finish
|
||||||
|
And I am on the aspects manage page
|
||||||
|
Then I should see no contacts in "Besties"
|
||||||
|
|
||||||
|
Scenario: cancel removing contact from the contact show page
|
||||||
|
When I go to the home page
|
||||||
|
And I follow "Besties" within "#aspect_listings"
|
||||||
|
And I wait for the ajax to finish
|
||||||
|
|
||||||
|
And I preemptively reject the alert
|
||||||
|
And I press the first ".added" within "#facebox .contact_list ul > li:first-child"
|
||||||
|
|
||||||
|
And I wait for the ajax to finish
|
||||||
|
And I am on the aspects manage page
|
||||||
|
Then I should see 1 contact in "Besties"
|
||||||
|
|
||||||
21
spec/javascripts/contact-list-spec.js
Normal file
21
spec/javascripts/contact-list-spec.js
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
/* Copyright (c) 2010, Diaspora Inc. This file is
|
||||||
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
|
* the COPYRIGHT file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
describe("Contact List", function() {
|
||||||
|
describe("disconnectUser", function() {
|
||||||
|
it("does an ajax call to person delete with the passed in id", function(){
|
||||||
|
var id = '3';
|
||||||
|
spyOn($,'ajax').andCallThrough();
|
||||||
|
List.disconnectUser(id);
|
||||||
|
expect($.ajax).toHaveBeenCalledWith(
|
||||||
|
url: "/people/" + id,
|
||||||
|
type: "DELETE",
|
||||||
|
success: function(){
|
||||||
|
$('.contact_list li[data-guid='+id+']').fadeOut(200);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Reference in a new issue