cirandas.net

ref: master

features/create_community.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Feature: create community
  As a noosfero user
  I want to create a community
  In order to interact with other people

  Background:
    Given the following users
      | login | name |
      | joaosilva | Joao Silva |

  Scenario: a user creates a community
    Given I am logged in as "joaosilva"
    And feature "admin_must_approve_new_communities" is disabled on environment
    And I go to joaosilva's control panel
    And I follow "Manage my groups"
    When I follow "Create a new community"
    And I fill in "Name" with "Fancy community"
    And I press "Create"
    Then I should see "Fancy community"
    And I should see "Fancy community"'s creation date

  Scenario: a user creates a community when environment moderates it
    Given I am logged in as "joaosilva"
    And feature "admin_must_approve_new_communities" is enabled on environment
    And I go to joaosilva's control panel
    And I follow "Manage my groups"
    And I follow "Create a new community"
    And I fill in "Name" with "Community for moderation"
    And I press "Create"
    Then I should not see "Community for moderation"

  Scenario: a user tries to create a community without a name
    Given I am logged in as "joaosilva"
    And feature "admin_must_approve_new_communities" is disabled on environment
    And I go to joaosilva's control panel
    And I follow "Manage my groups"
    When I follow "Create a new community"
    And I press "Create"
    Then I should see "Creating new community"

  Scenario: environment admin receive a task when a user creates a community
    Given I am logged in as "joaosilva"
    And feature "admin_must_approve_new_communities" is enabled on environment
    Given "joaosilva" creates the community "Community for approval"
    Given I am logged in as admin
    And I go to admin_user's control panel
    Then I should see "Joao Silva wants to create community Community for approval"

  Scenario: environment admin accepts new community task
    Given I am logged in as "joaosilva"
    And feature "admin_must_approve_new_communities" is enabled on environment
    Given "joaosilva" creates the community "Community for approval"
    Given I am logged in as admin
    And I go to admin_user's control panel
    And I follow "Process requests"
    And I should see "Joao Silva wants to create community Community for approval"
    And I choose "Accept"
    When I press "Apply!"
    Then I should not see "Joao Silva wants to create community Community for approval"
    And I go to joaosilva's control panel
    And I follow "Manage my groups"
    Then I should see "Community for approval"

  Scenario: environment admin rejects new community task
    Given I am logged in as "joaosilva"
    And feature "admin_must_approve_new_communities" is enabled on environment
    Given "joaosilva" creates the community "Community for approval"
    Given I am logged in as admin
    And I go to admin_user's control panel
    And I follow "Process requests"
    And I should see "Joao Silva wants to create community Community for approval"
    And I choose "Reject"
    When I press "Apply!"
    Then I should not see "Joao Silva wants to create community Community for approval"
    And I go to joaosilva's control panel
    And I follow "Manage my groups"
    Then I should not see "Community for approval"

  Scenario: new community is listed after approval
    Given I am logged in as admin
    And feature "admin_must_approve_new_communities" is enabled on environment
    Given "admin_user" creates the community "Community for approval"
    And I approve community "Community for approval"
    And I go to admin_user's control panel
    And I follow "Manage my groups"
    Then I should see "Community for approval"

  Scenario: new community is not listed after rejection
    Given I am logged in as admin
    And feature "admin_must_approve_new_communities" is enabled on environment
    Given "admin_user" creates the community "Community for approval"
    And I reject community "Community for approval"
    And I go to admin_user's control panel
    And I follow "Manage my groups"
    Then I should not see "Community for approval"