public
Description: The code for MyChores, open-source, freely available to anyone who wants it.
Homepage: http://www.mychores.co.uk
Clone URL: git://github.com/sermoa/mychores.git
Click here to lend your support to: mychores and make a donation at www.pledgie.com !
mychores / features / new_user_registration.feature
100644 124 lines (113 sloc) 5.776 kb
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
Feature: New user registration
  As a newbie
  I want to register on MyChores
  So that I can use its wonderful goodness
 
  Scenario: New user creates registration
    Given I am not logged in
    When I click on 'Register'
    Then I should see the text 'Register'
    When I fill in 'Desired login ID' with 'aimee'
    And I fill in 'Name' with 'Aimee'
    And I fill in 'Choose password' with '12345'
    And I fill in 'Confirm password' with '12345'
    And I fill in 'Email address' with 'aimee@test.com'
    And I click the 'Register' button
    Then I should see the text 'Hi Aimee, thank you for signing up with MyChores'
 
  Scenario: Test login ID validation
    Given I am not logged in
    When I click on 'Register'
    And I click the 'Register' button
    Then I should see the text 'Login is too short \(minimum is 3 characters\)'
    And I should NOT see the text 'Login can\'t be blank'
    When I fill in 'Desired login ID' with '!!!!!'
    And I click the 'Register' button
    Then I should see the text 'Login can only contain letters and numbers'
    And I should NOT see the text 'Login is too short \(minimum is 3 characters\)'
    When I fill in 'Desired login ID' with 'good_login'
    And I click the 'Register' button
    Then I should NOT see the text 'Login can only contain letters and numbers'
    And I should NOT see the text 'Login is too short \(minimum is 3 characters\)'
    
  Scenario: Test duplicate logins (including with different case sensitivity)
    Given a person called 'Aimee' with login ID 'sermoa'
    And I am not logged in
    When I click on 'Register'
    And I fill in 'Desired login ID' with 'sermoa'
    And I click the 'Register' button
    Then I should see the text 'Login has already been taken'
    And I fill in 'Desired login ID' with 'SermOa'
    And I click the 'Register' button
    Then I should see the text 'Login has already been taken'
  
  Scenario: Test name validation
    Given I am not logged in
    When I click on 'Register'
    And I click the 'Register' button
    Then I should see the text 'Name can\'t be blank'
    When I fill in 'Name' with 'Blatantly far too long to ever be acceptable - you just know this is totally going to FAIL!'
    And I click the 'Register' button
    Then I should see the text 'Name is too long \(maximum is 40 characters\)'
    When I fill in 'Name' with '!@£\$%)(*$ <= acceptable!'
    And I click the 'Register' button
    Then I should NOT see the text 'Name can\'t be blank'
    And I should NOT see the text 'Name is too long \(maximum is 40 characters\)'
  
  Scenario: Test password validation
    Given I am not logged in
    When I click on 'Register'
    And I click the 'Register' button
    Then I should see the text 'Password is too short \(minimum is 5 characters\)'
    And I should NOT see the text 'Password can\'t be blank'
    When I fill in 'Choose password' with 'abcde'
    And I click the 'Register' button
    Then I should see the text 'Password doesn\'t match confirmation'
    And I should NOT see the text 'Password confirmation can\'t be blank'
    When I fill in 'Confirm password' with '12345'
    And I click the 'Register' button
    Then I should see the text 'Password doesn\'t match confirmation'
    When I fill in 'Choose password' with '12345'
    And I click the 'Register' button
    Then I should NOT see the text 'Password doesn\'t match confirmation'
    
  Scenario: Test email validation
    Given I am not logged in
    When I click on 'Register'
    And I click the 'Register' button
    Then I should see the text 'Email can\'t be blank'
    And I should NOT see the text 'Email seems to be invalid'
    When I fill in 'Email' with 'not_even_an_email_address'
    And I click the 'Register' button
    Then I should see the text 'Email seems to be invalid'
    And I should NOT see the text 'Email can\'t be blank'
    When I fill in 'Email' with 'wrong@verywrong'
    And I click the 'Register' button
    Then I should see the text 'Email seems to be invalid'
    When I fill in 'Email' with 'good_email@subdomain.good-domain.org.com.jp'
    And I click the 'Register' button
    Then I should NOT see the text 'Email seems to be invalid'
    And I should NOT see the text 'Email can\'t be blank'
    When I fill in 'Email' with 'a@b.co'
    And I click the 'Register' button
    Then I should NOT see the text 'Email seems to be invalid'
    And I should NOT see the text 'Email can\'t be blank'
    
  Scenario: Person has been referred by someone else
    Given a person called 'Aimee' with login ID 'aimee'
    And I am not logged in
    When I click on 'Register'
    And I fill in 'Desired login ID' with 'springysparkles'
    And I fill in 'Name' with 'Joanne'
    And I fill in 'Choose password' with '12345'
    And I fill in 'Confirm password' with '12345'
    And I fill in 'Email address' with 'joanne@test.com'
    And I fill in 'Referrer ID' with 'aimee'
    And I click the 'Register' button
    Then I should see the text 'Hi Joanne, thank you for signing up with MyChores'
    And the referrer ID for 'springysparkles' should be set to 'aimee'
    
  Scenario: Enter an invalid referrer ID
    Given I am not logged in
    When I click on 'Register'
    And I fill in 'Referrer ID' with 'blatantly_nobody_has_this_id'
    And I click the 'Register' button
    Then I should see the text 'Referrer is not recognised; please check again or leave it blank'
    
  Scenario: Referrer ID can be entered automatically if they followed a referral link
    Given a person called 'Aimee' with login ID 'aimee'
    And I am not logged in
    When I visit the page /home?referrer=aimee
    And I click on 'Register'
    Then the text field with id 'person_referrer' should be filled in with 'aimee'