connects_users.feature 2.57 KB
Newer Older
1
@javascript
2 3 4 5 6 7 8
Feature: sending and receiving requests

  Background: 
    Given a user with email "bob@bob.bob"
    And a user with email "alice@alice.alice"
    When I sign in as "bob@bob.bob"
    And I am on "alice@alice.alice"'s page
danielvincent's avatar
danielvincent committed
9 10
    And I press the first ".share_with.button" within "#author_info"
    And I press the first ".add.button" within "#facebox #aspects_list ul > li:first-child"
11
    #And I debug
12
    And I wait for the ajax to finish
danielvincent's avatar
danielvincent committed
13
    Then I should see a ".added.button" within "#facebox #aspects_list ul > li:first-child"
14
    Then I go to the destroy user session page
15 16
    
  Scenario: accepting a contact request
17 18 19 20 21 22 23 24 25 26
    When I sign in as "alice@alice.alice"
    And I am on the aspects manage page
    Then I should see 1 contact request
    When I drag the contact request to the "Besties" aspect
    And I wait for the ajax to finish
    Then I should see 1 contact in "Besties"

    When I go to the home page
    Then I go to the aspects manage page
    Then I should see 1 contact in "Besties"
27 28 29 30 31
    Then I go to the destroy user session page

    When I sign in as "bob@bob.bob"
    And I am on the aspects manage page
    Then I should see 1 contact in "Besties"
32

maxwell's avatar
maxwell committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
  Scenario: accepting a contact request to multiple aspects
    When I sign in as "alice@alice.alice"
    And I am on "bob@bob.bob"'s page
    And I press the 1st ".share_with.button" within "#author_info"
    And I press the 1st ".add.button" within "#facebox #aspects_list ul > li:first-child"
    And I wait for the ajax to finish
    And I press the 1st ".add.button" within "#facebox #aspects_list ul > li:nth-child(2)"
    And I wait for the ajax to finish

   When I go to the home page
   Then I go to the aspects manage page

   Then I should see 1 contact in "Unicorns"
   Then I should see 1 contact in "Besties"
   Then I go to the destroy user session page

   When I sign in as "bob@bob.bob"
   And I am on the aspects manage page
   Then I should see 1 contact in "Besties"


54 55 56 57 58 59 60 61 62 63 64
  
  Scenario: accepting a contact request into a new aspect
    When I sign in as "alice@alice.alice"
    And I am on "bob@bob.bob"'s page
    And I press the first ".share_with.button" within "#author_info"
    And I fill in "Name" with "Super People" in the modal window
    And I press "aspect_submit" in the modal window
    And I wait for the ajax to finish

   When I go to the home page
   Then I go to the aspects manage page
65

66 67 68 69 70 71
   Then I should see 1 contact in "Super People"
   Then I go to the destroy user session page

   When I sign in as "bob@bob.bob"
   And I am on the aspects manage page
   Then I should see 1 contact in "Besties"