search.feature 2.12 KB
Newer Older
1 2 3 4 5 6 7 8
@javascript
Feature: search for users and hashtags
  In order to find my friends on diaspora
  As a user
  I want search for them

Background:
  Given following users exist:
9 10 11 12
  | username       | email             |
  | Bob Jones      | bob@bob.bob       |
  | Alice Smith    | alice@alice.alice |
  | Carol Williams | carol@example.com |
13 14

Scenario: search for a user and go to its profile
15 16 17
  When I sign in as "bob@bob.bob"
  And I enter "Alice Sm" in the search input
  Then I should see "Alice Smith" within ".tt-menu"
18 19 20 21 22

  When I click on the first search result
  Then I should see "Alice Smith" within ".profile_header #name"

Scenario: search for a inexistent user and go to the search page
23 24 25
  When I sign in as "bob@bob.bob"
  And I enter "Trinity" in the search input
  And I press enter in the search input
26 27 28

  Then I should see "Users matching Trinity" within "#search_title"

29 30 31 32 33
Scenario: search for a user in background
  When I sign in as "bob@bob.bob"
  And I search for "user@pod.tld"
  And a person with ID "user@pod.tld" has been discovered
  Then I should see "user@pod.tld" within ".stream .info.diaspora_handle"
34
  And I should see a ".aspect-dropdown" within ".stream"
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

Scenario: search for a not searchable user
  When I sign in as "carol@example.com"
  And I go to the edit profile page
  And I mark myself as not searchable
  And I submit the form
  Then I should be on the edit profile page
  And the "profile[searchable]" checkbox should not be checked

  When I sign out
  And I sign in as "bob@bob.bob"
  And I enter "Carol Wi" in the search input
  Then I should not see any search results

  Given a user with email "bob@bob.bob" is connected with "carol@example.com"
  When I go to the home page
  And I enter "Carol Wi" in the search input
  Then I should see "Carol Williams" within ".tt-menu"

  When I click on the first search result
  Then I should see "Carol Williams" within ".profile_header #name"

57
Scenario: search for a tag
58 59 60
  When I sign in as "bob@bob.bob"
  And I enter "#Matrix" in the search input
  Then I should see "#Matrix" within ".tt-menu"
61 62 63

  When I click on the first search result
  Then I should be on the tag page for "matrix"