cirandas.net

ref: master

features/members_block.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
Feature:
  In order to enter in a community
  As a logged user
  I want to enter in a community by 'join leave' button in members block

  Background:
    Given the following users
      | login      | name        |
      | joaosilva  | Joao Silva  |
      | mariasilva | Maria Silva |
    And the following communities
      | owner     | identifier        | name              |
      | joaosilva | sample-community  | Sample Community  |
    And the following blocks
      | owner            | type         |
      | sample-community | MembersBlock |
    And I am logged in as "joaosilva"
    And I go to sample-community's control panel
    And I follow "Edit sideboxes"
    And I follow "Edit" within ".members-block"
    And I check "Show join leave button"
    And I press "Save"

  Scenario: a user can join in a community by members block's button
    Given I am logged in as "mariasilva"
    And I go to sample-community's homepage
    When I follow "Join this community" within ".members-block"
    And I go to mariasilva's control panel
    And I follow "Manage my groups"
    Then I should see "Sample Community"

  Scenario: a not logged in user can log in by members block's button
    Given I am not logged in
    When I go to sample-community's homepage
    And I follow "Join this community" within ".members-block"
    Then I should see "Username / Email"

  Scenario: the join-leave button do not appear if the checkbox show-join-leave-button is not checked
    And I go to sample-community's control panel
    And I follow "Edit sideboxes"
    And I follow "Edit" within ".members-block"
    And I uncheck "Show join leave button"
    And I press "Save"
    When I go to sample-community's homepage
    Then I should not see "Join this community" within ".members-block"
    And I should not see "Leave community" within ".members-block"