summaryrefslogtreecommitdiffstats
path: root/tests/integration/features/conversation/join-listable.feature
blob: dc5741f3c92941a1d2432598bdae226015c260c1 (plain)
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Feature: conversation/join-listable
  Background:
    Given user "creator" exists
    And user "regular-user" exists
    And guest accounts can be created
    And user "user-guest@example.com" is a guest account user
    # implicit: And user "guest" is a guest user with no account

  # -----------------------------------------------------------------------------
  # Non-listed rooms
  # -----------------------------------------------------------------------------
  Scenario: Nobody can join a non-listed group room
    Given user "creator" creates room "room"
      | roomType | 2    |
      | roomName | room |
    When user "creator" allows listing room "room" for "none" with 200
    Then user "regular-user" joins room "room" with 404
    And user "user-guest@example.com" joins room "room" with 404
    And user "guest" joins room "room" with 404

  Scenario: Anyone can join a non-listed public room
    Given user "creator" creates room "room"
      | roomType | 3    |
      | roomName | room |
    And user "creator" allows listing room "room" for "none" with 200
    When user "regular-user" joins room "room" with 200
    And user "user-guest@example.com" joins room "room" with 200
    And user "guest" joins room "room" with 200
    Then user "creator" sees the following attendees in room "room" with 200 (v3)
      | actorId                | participantType   | actorType |
      | creator                | OWNER             | users     |
      | regular-user           | USER_SELF_JOINED  | users     |
      | user-guest@example.com | USER_SELF_JOINED  | users     |
      | "guest"                | GUEST             | guests    |

  # -----------------------------------------------------------------------------
  # User-listed rooms
  # -----------------------------------------------------------------------------
  Scenario: Only regular users can join a user-listed group room
    Given user "creator" creates room "room"
      | roomType | 2    |
      | roomName | room |
    And user "creator" allows listing room "room" for "users" with 200
    When user "regular-user" joins room "room" with 200
    And user "user-guest@example.com" joins room "room" with 404
    And user "guest" joins room "room" with 404
    Then user "creator" sees the following attendees in room "room" with 200 (v3)
      | actorId       | participantType | actorType |
      | creator       | OWNER           | users     |
      | regular-user  | USER            | users     |

  Scenario: Anyone can join a user-listed public room
    Given user "creator" creates room "room"
      | roomType | 3    |
      | roomName | room |
    And user "creator" allows listing room "room" for "users" with 200
    When user "regular-user" joins room "room" with 200
    And user "user-guest@example.com" joins room "room" with 200
    And user "guest" joins room "room" with 200
    Then user "creator" sees the following attendees in room "room" with 200 (v3)
      | actorId                | participantType   | actorType |
      | creator                | OWNER             | users     |
      | regular-user           | USER              | users     |
      | user-guest@example.com | USER_SELF_JOINED  | users     |
      | "guest"                | GUEST             | guests    |

  # -----------------------------------------------------------------------------
  # All-listed rooms
  # -----------------------------------------------------------------------------
  Scenario: Only users with accounts can join an all-listed group room
    Given user "creator" creates room "room"
      | roomType | 2    |
      | roomName | room |
    And user "creator" allows listing room "room" for "all" with 200
    When user "regular-user" joins room "room" with 200
    And user "user-guest@example.com" joins room "room" with 200
    And user "guest" joins room "room" with 404
    Then user "creator" sees the following attendees in room "room" with 200 (v3)
      | actorId                | participantType   | actorType |
      | creator                | OWNER             | users     |
      | regular-user           | USER              | users     |
      | user-guest@example.com | USER              | users     |

  Scenario: Anyone can join an all-listed public room
    Given user "creator" creates room "room"
      | roomType | 3    |
      | roomName | room |
    And user "creator" allows listing room "room" for "all" with 200
    When user "regular-user" joins room "room" with 200
    And user "user-guest@example.com" joins room "room" with 200
    And user "guest" joins room "room" with 200
    Then user "creator" sees the following attendees in room "room" with 200 (v3)
      | actorId                | participantType   | actorType |
      | creator                | OWNER             | users     |
      | regular-user           | USER              | users     |
      | user-guest@example.com | USER              | users     |
      | "guest"                | GUEST             | guests    |

  # -----------------------------------------------------------------------------
  # Join listed conversation which has a password
  # -----------------------------------------------------------------------------
  Scenario: Only users with accounts can join an all-listed group room
    Given user "creator" creates room "room" (v3)
      | roomType | 3    |
      | roomName | room |
    When user "creator" sets password "foobar" for room "room" with 200 (v3)
    And user "creator" allows listing room "room" for "all" with 200 (v3)
    When user "regular-user" joins room "room" with 200 (v3)
    Then user "creator" sees the following attendees in room "room" with 200 (v3)
      | actorId                | participantType   | actorType |
      | creator                | OWNER             | users     |
      | regular-user           | USER              | users     |