cirandas.net

ref: master

features/profile_search.feature


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Feature: search inside a profile
  As a noosfero user
  I want to search
  In order to find stuff from a profile

  Background:
    Given the following users
      | login     | name       |
      | joaosilva | Joao Silva |
    And the following articles
      | owner     | name                 | body |
      | joaosilva | bees and butterflies | this is an article about bees and butterflies |
      | joaosilva | whales and dolphins  | this is an article about whales and dolphins  |

  Scenario: search on profile
    Given I go to joaosilva's profile
    And I fill in "q" with "bees"
    And I press "Search"
    Then I should see "bees and butterflies" within ".main-block"
    And I should not see "whales and dolphins" within ".main-block"

  Scenario: search for event on profile
    Given the following events
      | owner     | name                | start_date |
      | joaosilva | Group meeting       | 2009-10-01 |
      | joaosilva | John Doe's birthday | 2009-09-01 |
    When I go to joaosilva's profile
    And I fill in "q" with "birthday"
    And I press "Search"
    Then I should see "John Doe's birthday" within ".main-block"
    And I should not see "Group meeting" within ".main-block"

  Scenario: simple search for event on profile search block
    Given the following blocks
      | owner     | type                |
      | joaosilva | ProfileSearchBlock  |
    When I go to joaosilva's profile
    And I fill in "q" with "bees" within ".profile-search-block"
    And I press "Search" within ".profile-search-block"
    Then I should see "bees and butterflies" within ".main-block"

  Scenario: not display unpublished articles
    Given the following articles
      | owner     | name                | body                      | published |
      | joaosilva | published article   | this is a public article  | true      |
      | joaosilva | unpublished article | this is a private article | false     |
    And I go to joaosilva's profile
    And I fill in "q" with "article"
    And I press "Search"
    Then I should see "published article" within ".main-block"
    And I should not see "unpublished article" within ".main-block"

  Scenario: search on environment
    Given I go to joaosilva's profile
    And I fill in "q" with "bees"
    And I choose "General"
    And I press "Search"
    Then I should be on the search page
    And I should see "bees and butterflies" within "#search-page"

  Scenario: not display search on private profiles
    Given the following users
      | login      | name        | public_profile |
      | mariasilva | Maria Silva | false          |
    And I go to /profile/mariasilva/search
    Then I should see "friends only"