File: example.feature

package info (click to toggle)
ruby-email-spec 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 980 kB
  • sloc: ruby: 2,420; makefile: 3
file content (93 lines) | stat: -rw-r--r-- 3,787 bytes parent folder | download
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
Feature: EmailSpec Example -- Prevent Bots from creating accounts

  In order to help alleviate email testing in apps
  As an email-spec contributor I want new users of the library
  to easily adopt email-spec in their app by following this example

  In order to prevent bots from setting up new accounts
  As a site manager I want new users
  to verify their email address with a confirmation link

  Background:
    Given no emails have been sent
    And I am a real person wanting to sign up for an account
    And I am on the homepage
    And I submit my registration information

  Scenario: First person signup (as myself) with three ways of opening email
    Then I should receive an email
    And I should have 1 email

    # Opening email #1
    When I open the email
    Then I should see "Account confirmation" in the email subject
    And I should see "Joe Someone" in the email body
    And I should see "confirm" in the email body

    # Opening email #2
    When I open the email with subject "Account confirmation"
    Then I should see "Account confirmation" in the email subject
    And I should see "Joe Someone" in the email body
    And I should see "confirm" in the email body

    # Opening email #3
    When I open the email with subject /Account confirmation/
    Then I should see "Account confirmation" in the email subject
    And I should see "Joe Someone" in the email body
    And I should see "confirm" in the email body

    When I follow "Click here to confirm your account!" in the email
    Then I should see "Confirm your new account"

    And "foo@bar.com" should have no emails

  Scenario: Third person signup (emails sent to others) with three ways of opening email
    Then "foo@bar.com" should have no emails
    And "example@example.com" should receive an email
    And "example@example.com" should have 1 email

    # Opening email #1
    When they open the email
    Then they should see "Account confirmation" in the email subject
    And they should see "Joe Someone" in the email body
    And they should see "confirm" in the email body

    # Opening email #2
    When "example@example.com" opens the email with subject "Account confirmation"
    Then they should see "Account confirmation" in the email subject
    And they should see "Joe Someone" in the email body
    And they should see "confirm" in the email body

    # Opening email #3
    When "example@example.com" opens the email with subject /Account confirmation/
    Then they should see "Account confirmation" in the email subject
    And they should see "Joe Someone" in the email body
    And they should see "confirm" in the email body

    When they follow "Click here to confirm your account!" in the email
    Then they should see "Confirm your new account"

  Scenario: Declarative First Person signup
    Then I should receive an email with a link to a confirmation page

  Scenario: Declarative First Person signup
    Then they should receive an email with a link to a confirmation page

  Scenario: Checking for text in different parts
    Then I should receive an email
    And I should have 1 email

    # Opening email #1
    When I open the email
    Then I should see "This is the HTML part" in the email html part body
    And I should see "This is the text part" in the email text part body

    # Opening email #2
    When I open the email with text "This is the HTML part"
    Then I should see "This is the HTML part" in the email html part body
    And I should see "This is the text part" in the email text part body

    # Opening email #3
    When I open the email with text /This is the HTML part/
    Then I should see "This is the HTML part" in the email html part body
    And I should see "This is the text part" in the email text part body