cirandas.net

ref: master

features/signup.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
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
Feature: signup
  As a new user
  I want to sign up to the site
  So I can have fun using its features

  @selenium
  Scenario: successfull registration
    Given I am on the homepage
    When I follow "Login"
    And I follow "New user"
    And I fill in the following within ".no-boxes":
      | e-Mail                | josesilva@example.com |
      | Username              | josesilva             |
      | Password              | secret                |
      | Password confirmation | secret                |
      | Full name             | José da Silva         |
    And wait for the captcha signup time
    And I press "Create my account"
    And there are no pending jobs
    Then I should receive an e-mail on josesilva@example.com
    When I go to login page
    And I fill in "Username" with "josesilva"
    And I fill in "Password" with "secret"
    And I press "Log in"
    Then I should not be logged in as "josesilva"
    When José da Silva's account is activated
    And I go to login page
    And I fill in "Username" with "josesilva"
    And I fill in "Password" with "secret"
    And I press "Log in"
    Then I should be logged in as "josesilva"

  @selenium
  Scenario: show error message if username is already used
    Given the following users
      | login     |
      | josesilva |
    When I go to signup page
    And I fill in "Username" with "josesilva"
    And I fill in "e-Mail" with "josesilva1"
    Then I should see "This login name is unavailable"

  Scenario: be redirected if user goes to signup page and is logged
    Given the following users
      | login | name |
      | joaosilva | joao silva |
    Given I am logged in as "joaosilva"
    And I go to signup page
    Then I should be on joaosilva's control panel

  @selenium
  Scenario: user cannot register without a name
    Given I am on the homepage
    And I follow "Login"
    And I follow "New user"
    And I fill in "e-Mail" with "josesilva@example.com"
    And I fill in "Username" with "josesilva"
    And I fill in "Password" with "secret"
    And I fill in "Password confirmation" with "secret"
    And wait for the captcha signup time
    And I press "Create my account"
    Then I should see "Name can't be blank"

  Scenario: user cannot change his name to empty string
    Given the following users
      | login | name |
      | joaosilva | Joao Silva |
    Given I am logged in as "joaosilva"
    And I am on joaosilva's control panel
    And I follow "Edit Profile"
    And I fill in "Name" with ""
    When I press "Save"
    Then I should see "Name can't be blank"


  @selenium
  Scenario: user should go to his homepage after signup
    Given the environment is configured to redirect to profile homepage after signup
    And feature "skip_new_user_email_confirmation" is enabled on environment
    And I am on /search/people
    When I follow "Sign up"
    And I fill in the following within ".no-boxes":
      | e-Mail                | josesilva@example.com |
      | Username              | josesilva             |
      | Password              | secret                |
      | Password confirmation | secret                |
      | Full name             | José da Silva         |
    And wait for the captcha signup time
    And I press "Create my account"
    Then I should be on josesilva's profile

  @selenium
  Scenario: user should go to his control panel after signup
    Given the environment is configured to redirect to profile control panel after signup
    And feature "skip_new_user_email_confirmation" is enabled on environment
    And I am on /search/people
    When I follow "Sign up"
    And I fill in the following within ".no-boxes":
      | e-Mail                | josesilva@example.com |
      | Username              | josesilva             |
      | Password              | secret                |
      | Password confirmation | secret                |
      | Full name             | José da Silva         |
    And wait for the captcha signup time
    And I press "Create my account"
    Then I should be on josesilva's control panel

  @selenium
  Scenario: user should go to his profile page after signup
    Given the environment is configured to redirect to user profile page after signup
    And feature "skip_new_user_email_confirmation" is enabled on environment
    And I am on /search/people
    When I follow "Sign up"
    And I fill in the following within ".no-boxes":
      | e-Mail                | josesilva@example.com |
      | Username              | josesilva             |
      | Password              | secret                |
      | Password confirmation | secret                |
      | Full name             | José da Silva         |
    And wait for the captcha signup time
    And I press "Create my account"
    Then I should be on josesilva's profile

  @selenium
  Scenario: user should go to the environment's homepage after signup
    Given the environment is configured to redirect to site homepage after signup
    And feature "skip_new_user_email_confirmation" is enabled on environment
    And I am on /search/people
    When I follow "Sign up"
    And I fill in the following within ".no-boxes":
      | e-Mail                | josesilva@example.com |
      | Username              | josesilva             |
      | Password              | secret                |
      | Password confirmation | secret                |
      | Full name             | José da Silva         |
    And wait for the captcha signup time
    And I press "Create my account"
    Then I should be on the homepage

  @selenium
  Scenario: user should go to the environment's welcome page after signup
    Given the environment is configured to redirect to welcome page after signup
    And I am on /search/people
    When I follow "Sign up"
    And I fill in the following within ".no-boxes":
      | e-Mail                | josesilva@example.com |
      | Username              | josesilva             |
      | Password              | secret                |
      | Password confirmation | secret                |
      | Full name             | José da Silva         |
    And wait for the captcha signup time
    And I press "Create my account"
    Then I should be on the welcome page

  @selenium
  Scenario: user should go to his homepage after following confirmation link
    Given the environment is configured to redirect to profile homepage after login
    And feature "skip_new_user_email_confirmation" is disabled on environment
    And I am on /search/people
    When I follow "Sign up"
    And I fill in the following within ".no-boxes":
      | e-Mail                | josesilva@example.com |
      | Username              | josesilva             |
      | Password              | secret                |
      | Password confirmation | secret                |
      | Full name             | José da Silva         |
    And wait for the captcha signup time
    And I press "Create my account"
    And I go to josesilva's confirmation URL
    And I fill in "Username" with "josesilva"
    And I fill in "Password" with "secret"
    And I press "Log in"
    Then I should be on /profile/josesilva

  @selenium
  Scenario: user should go to his control panel after following confirmation link
    Given the environment is configured to redirect to profile control panel after login
    And feature "skip_new_user_email_confirmation" is disabled on environment
    And I am on /search/people
    When I follow "Sign up"
    And I fill in the following within ".no-boxes":
      | e-Mail                | josesilva@example.com |
      | Username              | josesilva             |
      | Password              | secret                |
      | Password confirmation | secret                |
      | Full name             | José da Silva         |
    And wait for the captcha signup time
    And I press "Create my account"
    And I go to josesilva's confirmation URL
    And I fill in "Username" with "josesilva"
    And I fill in "Password" with "secret"
    And I press "Log in"
    Then I should be on /myprofile/josesilva

  @selenium
  Scenario: user should go to his profile page after following confirmation link
    Given the environment is configured to redirect to user profile page after login
    And feature "skip_new_user_email_confirmation" is disabled on environment
    And I am on /search/people
    When I follow "Sign up"
    And I fill in the following within ".no-boxes":
      | e-Mail                | josesilva@example.com |
      | Username              | josesilva             |
      | Password              | secret                |
      | Password confirmation | secret                |
      | Full name             | José da Silva         |
    And wait for the captcha signup time
    And I press "Create my account"
    And I go to josesilva's confirmation URL
    And I fill in "Username" with "josesilva"
    And I fill in "Password" with "secret"
    And I press "Log in"
    Then I should be on /profile/josesilva

  @selenium
  Scenario: user should go to the environment homepage after following confirmation link
    Given the environment is configured to redirect to site homepage after login
    And feature "skip_new_user_email_confirmation" is disabled on environment
    And I am on /search/people
    When I follow "Sign up"
    And I fill in the following within ".no-boxes":
      | e-Mail                | josesilva@example.com |
      | Username              | josesilva             |
      | Password              | secret                |
      | Password confirmation | secret                |
      | Full name             | José da Silva         |
    And wait for the captcha signup time
    And I press "Create my account"
    And I go to josesilva's confirmation URL
    And I fill in "Username" with "josesilva"
    And I fill in "Password" with "secret"
    And I press "Log in"
    Then I should be on the homepage

  @selenium
  Scenario: user registration is moderated by admin
    Given feature "admin_must_approve_new_users" is enabled on environment
    And feature "skip_new_user_email_confirmation" is disabled on environment
    And I go to /account/signup
    And I fill in "Username" with "teste"
    And I fill in "Password" with "123456"
    And I fill in "Password confirmation" with "123456"
    And I fill in "e-Mail" with "teste@teste.com"
    And I fill in "Full name" with "Teste da Silva"
    And wait for the captcha signup time
    And I press "Create my account"
    And I go to teste's confirmation URL
    And I am logged in as admin
    And I follow "Control panel"
    And I follow "Tasks"
    And I choose "Accept"
    And I press "Apply!"
    And I follow "Logout"
    And Teste da Silva's account is activated
    When I go to login page
    And I fill in "Username / Email" with "teste"
    And I fill in "Password" with "123456"
    And I press "Log in"
    Then I should see "teste"


  @selenium
  Scenario: user registration is not accepted by the admin
    Given feature "admin_must_approve_new_users" is enabled on environment
    And feature "skip_new_user_email_confirmation" is disabled on environment
    And I go to /account/signup
    And I fill in "Username" with "teste"
    And I fill in "Password" with "123456"
    And I fill in "Password confirmation" with "123456"
    And I fill in "e-Mail" with "teste@teste.com"
    And I fill in "Full name" with "Teste da Silva"
    And wait for the captcha signup time
    And I press "Create my account"
    And I go to teste's confirmation URL
    And I am logged in as admin
    And I follow "Control panel"
    And I follow "Tasks"
    And I choose "Reject"
    And I press "Apply!"
    And I follow "Logout"
    And I follow "Login"
    And I fill in "Username / Email" with "teste"
    And I fill in "Password" with "123456"
    And I press "Log in"
    Then I should not see "teste"