email_spec 0.3.8 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +9 -0
- data/README.rdoc +14 -4
- data/examples/rails_root/config/environments/test.rb +1 -0
- data/lib/email_spec/cucumber.rb +7 -2
- data/lib/email_spec/deliveries.rb +15 -5
- data/lib/email_spec/matchers.rb +9 -6
- data/spec/email_spec/matchers_spec.rb +25 -5
- metadata +2 -9
- data/examples/rails_root/db/test.sqlite3 +0 -0
- data/examples/rails_root/features/step_definitions/email_steps.rb +0 -143
- data/examples/rails_root/log/development.log +0 -1
- data/examples/rails_root/log/test.log +0 -670
- data/examples/rails_root/vendor/plugins/email_spec/rails_generators/email_spec/email_spec_generator.rb +0 -17
- data/examples/rails_root/vendor/plugins/email_spec/rails_generators/email_spec/templates/email_steps.rb +0 -143
- data/examples/sinatra/webrat.log +0 -45
data/History.txt
CHANGED
@@ -4,6 +4,15 @@
|
|
4
4
|
|
5
5
|
=== Bufixes
|
6
6
|
|
7
|
+
== 0.4.0 2010-01-07
|
8
|
+
|
9
|
+
=== New features
|
10
|
+
* Added support for action_mailer_cache_delivery plugin. (Dan Dofter)
|
11
|
+
You must use the fork at: http://github.com/liangzan/action_mailer_cache_delivery
|
12
|
+
|
13
|
+
=== Bufixes
|
14
|
+
* be_delivered_from matcher now compares both sender name and email address. (Dan Dofter)
|
15
|
+
|
7
16
|
== 0.3.8 2009-12-23
|
8
17
|
|
9
18
|
=== Bufixes
|
data/README.rdoc
CHANGED
@@ -2,13 +2,24 @@
|
|
2
2
|
|
3
3
|
A collection of RSpec matchers and Cucumber steps to make testing emails go smoothly.
|
4
4
|
|
5
|
+
This library works with ActionMailer and Pony. When using it with ActionMailer it works with
|
6
|
+
DelayedJob, ActiveRecord Mailer, and action_mailer_cache_delivery.
|
7
|
+
|
8
|
+
When using the action_mailer_cache_delivery library you must use this fork:
|
9
|
+
http://github.com/liangzan/action_mailer_cache_delivery
|
10
|
+
|
11
|
+
If you are testing emails in conjunction with an automated browser solution, like Selenium,
|
12
|
+
you will want to use action_mailer_cache_delivery in your test environment. (This is
|
13
|
+
because your test process and server processes are distinct and therefore need an
|
14
|
+
intermediate store for the emails.) DelayedJob and ActiveRecord Mailer will also work but
|
15
|
+
you generally don't want to include those projects unless you need them in production.
|
5
16
|
|
6
17
|
== Setup
|
7
18
|
|
8
19
|
script/plugin install git://github.com/bmabey/email-spec.git
|
9
20
|
|
10
21
|
=== Gem Setup
|
11
|
-
|
22
|
+
|
12
23
|
gem install email_spec
|
13
24
|
|
14
25
|
# config/environments/test.rb
|
@@ -32,10 +43,9 @@ This will give you a bunch of steps to get started with in step_definitions/emai
|
|
32
43
|
|
33
44
|
=== RSpec
|
34
45
|
|
35
|
-
First you need to require
|
46
|
+
First you need to require email_spec in your spec_helper.rb:
|
36
47
|
|
37
|
-
require "email_spec
|
38
|
-
require "email_spec/matchers"
|
48
|
+
require "email_spec"
|
39
49
|
|
40
50
|
You will then need to include EmailSpec::Helpers and EmailSpec::Matchers in your example groups.
|
41
51
|
If you want to have access to the helpers and matchers in all of your examples you can do the following in your spec_helper.rb:
|
@@ -23,6 +23,7 @@ config.action_mailer.delivery_method = :test
|
|
23
23
|
config.action_mailer.default_url_options = { :host => "example.com" }
|
24
24
|
|
25
25
|
config.gem 'cucumber', :lib => false
|
26
|
+
config.gem 'cucumber-rails', :lib => false
|
26
27
|
config.gem 'webrat', :lib => false
|
27
28
|
config.gem 'rspec', :lib => false
|
28
29
|
config.gem 'rspec-rails', :lib => 'spec/rails'
|
data/lib/email_spec/cucumber.rb
CHANGED
@@ -2,12 +2,17 @@
|
|
2
2
|
|
3
3
|
# Global Setup
|
4
4
|
if defined?(ActionMailer)
|
5
|
-
|
5
|
+
unless [:activerecord, :cache].include?(ActionMailer::Base.delivery_method)
|
6
|
+
ActionMailer::Base.delivery_method = :test
|
7
|
+
end
|
6
8
|
ActionMailer::Base.perform_deliveries = true
|
7
9
|
|
8
10
|
Before do
|
9
11
|
# Scenario setup
|
10
|
-
|
12
|
+
case ActionMailer::Base.delivery_method
|
13
|
+
when :test then ActionMailer::Base.deliveries.clear
|
14
|
+
when :cache then ActionMailer::Base.clear_cache
|
15
|
+
end
|
11
16
|
end
|
12
17
|
end
|
13
18
|
|
@@ -1,19 +1,29 @@
|
|
1
1
|
module EmailSpec
|
2
2
|
module MailerDeliveries
|
3
3
|
def all_emails
|
4
|
-
|
4
|
+
deliveries
|
5
5
|
end
|
6
6
|
|
7
7
|
def last_email_sent
|
8
|
-
|
8
|
+
deliveries.last || raise("No email has been sent!")
|
9
9
|
end
|
10
10
|
|
11
11
|
def reset_mailer
|
12
|
-
|
12
|
+
deliveries.clear
|
13
13
|
end
|
14
14
|
|
15
15
|
def mailbox_for(address)
|
16
|
-
|
16
|
+
deliveries.select { |m| m.to.include?(address) || (m.bcc && m.bcc.include?(address)) || (m.cc && m.cc.include?(address)) }
|
17
|
+
end
|
18
|
+
|
19
|
+
protected
|
20
|
+
|
21
|
+
def deliveries
|
22
|
+
if ActionMailer::Base.delivery_method == :cache
|
23
|
+
mailer.cached_deliveries
|
24
|
+
else
|
25
|
+
mailer.deliveries
|
26
|
+
end
|
17
27
|
end
|
18
28
|
end
|
19
29
|
|
@@ -60,7 +70,7 @@ module EmailSpec
|
|
60
70
|
|
61
71
|
module Deliveries
|
62
72
|
if defined?(Pony)
|
63
|
-
def
|
73
|
+
def deliveries; Pony::deliveries ; end
|
64
74
|
include EmailSpec::MailerDeliveries
|
65
75
|
elsif ActionMailer::Base.delivery_method == :activerecord
|
66
76
|
include EmailSpec::ARMailerDeliveries
|
data/lib/email_spec/matchers.rb
CHANGED
@@ -40,25 +40,28 @@ module EmailSpec
|
|
40
40
|
class DeliverFrom
|
41
41
|
|
42
42
|
def initialize(email)
|
43
|
-
@
|
43
|
+
@expected_sender = TMail::Address.parse(email)
|
44
44
|
end
|
45
45
|
|
46
46
|
def description
|
47
|
-
"be delivered from #{@
|
47
|
+
"be delivered from #{@expected_sender.to_s}"
|
48
48
|
end
|
49
49
|
|
50
50
|
def matches?(email)
|
51
51
|
@email = email
|
52
|
-
@actual_sender = (email.
|
53
|
-
|
52
|
+
@actual_sender = (email.from_addrs || []).first
|
53
|
+
|
54
|
+
!@actual_sender.nil? &&
|
55
|
+
@actual_sender.address == @expected_sender.address &&
|
56
|
+
@actual_sender.name == @expected_sender.name
|
54
57
|
end
|
55
58
|
|
56
59
|
def failure_message
|
57
|
-
|
60
|
+
%(expected #{@email.inspect} to deliver from "#{@expected_sender.to_s}", but it delivered from "#{@actual_sender.to_s}")
|
58
61
|
end
|
59
62
|
|
60
63
|
def negative_failure_message
|
61
|
-
|
64
|
+
%(expected #{@email.inspect} not to deliver from "#{@expected_sender.to_s}", but it did)
|
62
65
|
end
|
63
66
|
end
|
64
67
|
|
@@ -80,19 +80,39 @@ describe EmailSpec::Matchers do
|
|
80
80
|
end
|
81
81
|
|
82
82
|
describe "#deliver_from" do
|
83
|
-
it "should match when the email is set to deliver from the
|
84
|
-
email = mock_email(:
|
83
|
+
it "should match when the email is set to deliver from the specified address" do
|
84
|
+
email = mock_email(:from_addrs => [TMail::Address.parse("jimmy_bean@yahoo.com")])
|
85
85
|
deliver_from("jimmy_bean@yahoo.com").should match(email)
|
86
86
|
end
|
87
|
+
|
88
|
+
it "should match when the email is set to deliver from the specified name and address" do
|
89
|
+
email = mock_email(:from_addrs => [TMail::Address.parse("Jimmy Bean <jimmy_bean@yahoo.com>")])
|
90
|
+
deliver_from("Jimmy Bean <jimmy_bean@yahoo.com>").should match(email)
|
91
|
+
end
|
87
92
|
|
88
|
-
it "should not match when the email
|
89
|
-
email = mock_email(:
|
93
|
+
it "should not match when the email does not have a sender" do
|
94
|
+
email = mock_email(:from_addrs => nil)
|
90
95
|
deliver_from("jimmy_bean@yahoo.com").should_not match(email)
|
91
96
|
end
|
97
|
+
|
98
|
+
it "should not match when the email addresses match but the names do not" do
|
99
|
+
email = mock_email(:from_addrs => [TMail::Address.parse("Jimmy Bean <jimmy_bean@yahoo.com>")])
|
100
|
+
deliver_from("Freddy Noe <jimmy_bean@yahoo.com>").should_not match(email)
|
101
|
+
end
|
102
|
+
|
103
|
+
it "should not match when the names match but the email addresses do not" do
|
104
|
+
email = mock_email(:from_addrs => [TMail::Address.parse("Jimmy Bean <jimmy_bean@yahoo.com>")])
|
105
|
+
deliver_from("Jimmy Bean <freddy_noe@yahoo.com>").should_not match(email)
|
106
|
+
end
|
92
107
|
|
108
|
+
it "should not match when the email is not set to deliver from the specified address" do
|
109
|
+
email = mock_email(:from_addrs => [TMail::Address.parse("freddy_noe@yahoo.com")])
|
110
|
+
deliver_from("jimmy_bean@yahoo.com").should_not match(email)
|
111
|
+
end
|
112
|
+
|
93
113
|
it "should give correct failure message when the email is not set to deliver from the specified address" do
|
94
114
|
matcher = deliver_from("jimmy_bean@yahoo.com")
|
95
|
-
matcher.matches?(mock_email(:inspect => 'email', :
|
115
|
+
matcher.matches?(mock_email(:inspect => 'email', :from_addrs => [TMail::Address.parse("freddy_noe@yahoo.com")]))
|
96
116
|
matcher.failure_message.should == %{expected email to deliver from "jimmy_bean@yahoo.com", but it delivered from "freddy_noe@yahoo.com"}
|
97
117
|
end
|
98
118
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email_spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Mabey
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date:
|
14
|
+
date: 2010-01-07 00:00:00 -07:00
|
15
15
|
default_executable:
|
16
16
|
dependencies: []
|
17
17
|
|
@@ -98,18 +98,14 @@ test_files:
|
|
98
98
|
- examples/rails_root/db/migrate/20090125013728_create_users.rb
|
99
99
|
- examples/rails_root/db/migrate/20090908054656_create_delayed_jobs.rb
|
100
100
|
- examples/rails_root/db/schema.rb
|
101
|
-
- examples/rails_root/db/test.sqlite3
|
102
101
|
- examples/rails_root/doc/README_FOR_APP
|
103
102
|
- examples/rails_root/features/delayed_job.feature
|
104
103
|
- examples/rails_root/features/errors.feature
|
105
104
|
- examples/rails_root/features/example.feature
|
106
|
-
- examples/rails_root/features/step_definitions/email_steps.rb
|
107
105
|
- examples/rails_root/features/step_definitions/user_steps.rb
|
108
106
|
- examples/rails_root/features/step_definitions/webrat_steps.rb
|
109
107
|
- examples/rails_root/features/support/env.rb
|
110
108
|
- examples/rails_root/features/support/paths.rb
|
111
|
-
- examples/rails_root/log/development.log
|
112
|
-
- examples/rails_root/log/test.log
|
113
109
|
- examples/rails_root/public/404.html
|
114
110
|
- examples/rails_root/public/422.html
|
115
111
|
- examples/rails_root/public/500.html
|
@@ -149,8 +145,6 @@ test_files:
|
|
149
145
|
- examples/rails_root/spec/rcov.opts
|
150
146
|
- examples/rails_root/spec/spec.opts
|
151
147
|
- examples/rails_root/spec/spec_helper.rb
|
152
|
-
- examples/rails_root/vendor/plugins/email_spec/rails_generators/email_spec/email_spec_generator.rb
|
153
|
-
- examples/rails_root/vendor/plugins/email_spec/rails_generators/email_spec/templates/email_steps.rb
|
154
148
|
- examples/sinatra/app.rb
|
155
149
|
- examples/sinatra/features/errors.feature
|
156
150
|
- examples/sinatra/features/example.feature
|
@@ -158,4 +152,3 @@ test_files:
|
|
158
152
|
- examples/sinatra/features/step_definitions/webrat_steps.rb
|
159
153
|
- examples/sinatra/features/support/env.rb
|
160
154
|
- examples/sinatra/features/support/paths.rb
|
161
|
-
- examples/sinatra/webrat.log
|
Binary file
|
@@ -1,143 +0,0 @@
|
|
1
|
-
# Commonly used email steps
|
2
|
-
#
|
3
|
-
# To add your own steps make a custom_email_steps.rb
|
4
|
-
# The provided methods are:
|
5
|
-
#
|
6
|
-
# last_email_address
|
7
|
-
# reset_mailer
|
8
|
-
# open_last_email
|
9
|
-
# visit_in_email
|
10
|
-
# unread_emails_for
|
11
|
-
# mailbox_for
|
12
|
-
# current_email
|
13
|
-
# open_email
|
14
|
-
# read_emails_for
|
15
|
-
# find_email
|
16
|
-
#
|
17
|
-
# General form for email scenarios are:
|
18
|
-
# - clear the email queue (done automatically by email_spec)
|
19
|
-
# - execute steps that sends an email
|
20
|
-
# - check the user received an/no/[0-9] emails
|
21
|
-
# - open the email
|
22
|
-
# - inspect the email contents
|
23
|
-
# - interact with the email (e.g. click links)
|
24
|
-
#
|
25
|
-
# The Cucumber steps below are setup in this order.
|
26
|
-
|
27
|
-
module EmailHelpers
|
28
|
-
def current_email_address
|
29
|
-
# Replace with your a way to find your current email. e.g @current_user.email
|
30
|
-
# last_email_address will return the last email address used by email spec to find an email.
|
31
|
-
# Note that last_email_address will be reset after each Scenario.
|
32
|
-
last_email_address || "example@example.com"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
World(EmailHelpers)
|
37
|
-
|
38
|
-
#
|
39
|
-
# Reset the e-mail queue within a scenario.
|
40
|
-
# This is done automatically before each scenario.
|
41
|
-
#
|
42
|
-
|
43
|
-
Given /^(?:a clear email queue|no emails have been sent)$/ do
|
44
|
-
reset_mailer
|
45
|
-
end
|
46
|
-
|
47
|
-
#
|
48
|
-
# Check how many emails have been sent/received
|
49
|
-
#
|
50
|
-
|
51
|
-
Then /^(?:I|they|"([^"]*?)") should receive (an|no|\d+) emails?$/ do |address, amount|
|
52
|
-
unread_emails_for(address).size.should == parse_email_count(amount)
|
53
|
-
end
|
54
|
-
|
55
|
-
Then /^(?:I|they|"([^"]*?)") should have (an|no|\d+) emails?$/ do |address, amount|
|
56
|
-
mailbox_for(address).size.should == parse_email_count(amount)
|
57
|
-
end
|
58
|
-
|
59
|
-
# DEPRECATED
|
60
|
-
# The following methods are left in for backwards compatibility and
|
61
|
-
# should be removed by version 0.4.0
|
62
|
-
Then /^(?:I|they|"([^"]*?)") should not receive an email$/ do |address|
|
63
|
-
email_spec_deprecate "The step 'I/they/[email] should not receive an email' is no longer supported.
|
64
|
-
Please use 'I/they/[email] should receive no emails' instead."
|
65
|
-
unread_emails_for(address).size.should == 0
|
66
|
-
end
|
67
|
-
|
68
|
-
#
|
69
|
-
# Accessing emails
|
70
|
-
#
|
71
|
-
|
72
|
-
# Opens the most recently received email
|
73
|
-
When /^(?:I|they|"([^"]*?)") opens? the email$/ do |address|
|
74
|
-
open_email(address)
|
75
|
-
end
|
76
|
-
|
77
|
-
When /^(?:I|they|"([^"]*?)") opens? the email with subject "([^"]*?)"$/ do |address, subject|
|
78
|
-
open_email(address, :with_subject => subject)
|
79
|
-
end
|
80
|
-
|
81
|
-
When /^(?:I|they|"([^"]*?)") opens? the email with text "([^"]*?)"$/ do |address, text|
|
82
|
-
open_email(address, :with_text => text)
|
83
|
-
end
|
84
|
-
|
85
|
-
#
|
86
|
-
# Inspect the Email Contents
|
87
|
-
#
|
88
|
-
|
89
|
-
Then /^(?:I|they) should see "([^"]*?)" in the email subject$/ do |text|
|
90
|
-
current_email.should have_subject(text)
|
91
|
-
end
|
92
|
-
|
93
|
-
Then /^(?:I|they) should see \/([^"]*?)\/ in the email subject$/ do |text|
|
94
|
-
current_email.should have_subject(Regexp.new(text))
|
95
|
-
end
|
96
|
-
|
97
|
-
Then /^(?:I|they) should see "([^"]*?)" in the email body$/ do |text|
|
98
|
-
current_email.body.should include(text)
|
99
|
-
end
|
100
|
-
|
101
|
-
Then /^(?:I|they) should see \/([^"]*?)\/ in the email body$/ do |text|
|
102
|
-
current_email.body.should =~ Regexp.new(text)
|
103
|
-
end
|
104
|
-
|
105
|
-
Then /^(?:I|they) should see the email delivered from "([^"]*?)"$/ do |text|
|
106
|
-
current_email.should be_delivered_from(text)
|
107
|
-
end
|
108
|
-
|
109
|
-
Then /^(?:I|they) should see "([^\"]*)" in the email "([^"]*?)" header$/ do |text, name|
|
110
|
-
current_email.should have_header(name, text)
|
111
|
-
end
|
112
|
-
|
113
|
-
Then /^(?:I|they) should see \/([^\"]*)\/ in the email "([^"]*?)" header$/ do |text, name|
|
114
|
-
current_email.should have_header(name, Regexp.new(text))
|
115
|
-
end
|
116
|
-
|
117
|
-
|
118
|
-
# DEPRECATED
|
119
|
-
# The following methods are left in for backwards compatibility and
|
120
|
-
# should be removed by version 0.4.0.
|
121
|
-
Then /^(?:I|they) should see "([^"]*?)" in the subject$/ do |text|
|
122
|
-
email_spec_deprecate "The step 'I/they should see [text] in the subject' is no longer supported.
|
123
|
-
Please use 'I/they should see [text] in the email subject' instead."
|
124
|
-
current_email.should have_subject(Regexp.new(text))
|
125
|
-
end
|
126
|
-
Then /^(?:I|they) should see "([^"]*?)" in the email$/ do |text|
|
127
|
-
email_spec_deprecate "The step 'I/they should see [text] in the email' is no longer supported.
|
128
|
-
Please use 'I/they should see [text] in the email body' instead."
|
129
|
-
current_email.body.should =~ Regexp.new(text)
|
130
|
-
end
|
131
|
-
|
132
|
-
#
|
133
|
-
# Interact with Email Contents
|
134
|
-
#
|
135
|
-
|
136
|
-
When /^(?:I|they) follow "([^"]*?)" in the email$/ do |link|
|
137
|
-
visit_in_email(link)
|
138
|
-
end
|
139
|
-
|
140
|
-
When /^(?:I|they) click the first link in the email$/ do
|
141
|
-
click_first_link_in_email
|
142
|
-
end
|
143
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
# Logfile created on Wed Dec 16 23:20:00 -0700 2009
|
@@ -1,670 +0,0 @@
|
|
1
|
-
# Logfile created on Wed Dec 16 23:20:02 -0700 2009 [4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
2
|
-
FROM sqlite_master
|
3
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
4
|
-
[0m
|
5
|
-
[4;35;1mSQL (0.2ms)[0m [0mselect sqlite_version(*)[0m
|
6
|
-
[4;36;1mSQL (52.4ms)[0m [0;1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
7
|
-
[4;35;1mSQL (2.5ms)[0m [0mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
8
|
-
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
9
|
-
FROM sqlite_master
|
10
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
11
|
-
[0m
|
12
|
-
[4;35;1mSQL (0.1ms)[0m [0mSELECT version FROM schema_migrations[0m
|
13
|
-
Migrating to CreateUsers (20090125013728)
|
14
|
-
[4;36;1mSQL (0.5ms)[0m [0;1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "name" varchar(255)) [0m
|
15
|
-
[4;35;1mSQL (0.1ms)[0m [0mINSERT INTO schema_migrations (version) VALUES ('20090125013728')[0m
|
16
|
-
Migrating to CreateDelayedJobs (20090908054656)
|
17
|
-
[4;36;1mSQL (0.3ms)[0m [0;1m SELECT name
|
18
|
-
FROM sqlite_master
|
19
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
20
|
-
[0m
|
21
|
-
[4;35;1mSQL (0.5ms)[0m [0mCREATE TABLE "delayed_jobs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "priority" integer DEFAULT 0, "attempts" integer DEFAULT 0, "handler" text, "last_error" text, "run_at" datetime, "locked_at" datetime, "failed_at" datetime, "locked_by" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
22
|
-
[4;36;1mSQL (0.1ms)[0m [0;1mINSERT INTO schema_migrations (version) VALUES ('20090908054656')[0m
|
23
|
-
[4;35;1mSQL (0.4ms)[0m [0m SELECT name
|
24
|
-
FROM sqlite_master
|
25
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
26
|
-
[0m
|
27
|
-
[4;36;1mSQL (0.2ms)[0m [0;1mSELECT version FROM schema_migrations[0m
|
28
|
-
[4;35;1mSQL (0.2ms)[0m [0m SELECT name
|
29
|
-
FROM sqlite_master
|
30
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
31
|
-
[0m
|
32
|
-
[4;36;1mSQL (0.1ms)[0m [0;1mPRAGMA index_list("delayed_jobs")[0m
|
33
|
-
[4;35;1mSQL (0.1ms)[0m [0mPRAGMA index_list("users")[0m
|
34
|
-
REQUESTING PAGE: GET http://www.example.com/newsletter?Email=example%40example.com&Name=Joe+Someone with {} and HTTP headers {}
|
35
|
-
|
36
|
-
|
37
|
-
Processing WelcomeController#newsletter (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
38
|
-
Parameters: {"Name"=>"Joe Someone", "Email"=>"example@example.com"}
|
39
|
-
[4;36;1mDelayed::Job Create (0.4ms)[0m [0;1mINSERT INTO "delayed_jobs" ("locked_by", "updated_at", "handler", "priority", "run_at", "locked_at", "last_error", "attempts", "failed_at", "created_at") VALUES(NULL, '2009-12-17 06:20:07', '--- !ruby/struct:Delayed::PerformableMethod
|
40
|
-
object: CLASS:UserMailer
|
41
|
-
method: :deliver_newsletter
|
42
|
-
args:
|
43
|
-
- example@example.com
|
44
|
-
- Joe Someone
|
45
|
-
', 0, '2009-12-17 06:20:07', NULL, NULL, 0, NULL, '2009-12-17 06:20:07')[0m
|
46
|
-
Rendering welcome/newsletter
|
47
|
-
Completed in 57ms (View: 2, DB: 1) | 200 OK [http://www.example.com/newsletter?Email=example%40example.com&Name=Joe+Someone]
|
48
|
-
* [JOB] acquiring lock on UserMailer.deliver_newsletter
|
49
|
-
[4;35;1mDelayed::Job Update (0.1ms)[0m [0mUPDATE "delayed_jobs" SET locked_at = '2009-12-17 06:20:07', locked_by = 'host:Benz pid:2220' WHERE (id = 1 and (locked_at is null or locked_at < '2009-12-17 02:20:07') and (run_at <= '2009-12-17 06:20:07')) [0m
|
50
|
-
Sent mail to example@example.com
|
51
|
-
|
52
|
-
Date: Wed, 16 Dec 2009 23:20:07 -0700
|
53
|
-
From: admin@example.com
|
54
|
-
To: example@example.com
|
55
|
-
Subject: Newsletter sent
|
56
|
-
Mime-Version: 1.0
|
57
|
-
Content-Type: text/plain; charset=utf-8
|
58
|
-
|
59
|
-
Hello Joe Someone!
|
60
|
-
|
61
|
-
This week.....
|
62
|
-
.....
|
63
|
-
.....
|
64
|
-
|
65
|
-
Regards
|
66
|
-
Rails Example App
|
67
|
-
[4;36;1mDelayed::Job Destroy (0.1ms)[0m [0;1mDELETE FROM "delayed_jobs" WHERE "id" = 1[0m
|
68
|
-
* [JOB] UserMailer.deliver_newsletter completed after 0.0045
|
69
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
70
|
-
|
71
|
-
|
72
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
73
|
-
Rendering welcome/index
|
74
|
-
Completed in 2ms (View: 2, DB: 2) | 200 OK [http://www.example.com/]
|
75
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
76
|
-
|
77
|
-
|
78
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-16 23:20:07) [POST]
|
79
|
-
Parameters: {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
80
|
-
Sent mail to example@example.com
|
81
|
-
|
82
|
-
Date: Wed, 16 Dec 2009 23:20:07 -0700
|
83
|
-
From: admin@example.com
|
84
|
-
To: example@example.com
|
85
|
-
Subject: Account confirmation
|
86
|
-
Mime-Version: 1.0
|
87
|
-
Content-Type: text/plain; charset=utf-8
|
88
|
-
|
89
|
-
Hello !
|
90
|
-
|
91
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
92
|
-
Rendering welcome/signup
|
93
|
-
Completed in 5ms (View: 1, DB: 1) | 200 OK [http://www.example.com/welcome/signup]
|
94
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
95
|
-
|
96
|
-
|
97
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
98
|
-
Rendering welcome/index
|
99
|
-
Completed in 2ms (View: 1, DB: 1) | 200 OK [http://www.example.com/]
|
100
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
101
|
-
|
102
|
-
|
103
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-16 23:20:07) [POST]
|
104
|
-
Parameters: {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
105
|
-
Sent mail to example@example.com
|
106
|
-
|
107
|
-
Date: Wed, 16 Dec 2009 23:20:07 -0700
|
108
|
-
From: admin@example.com
|
109
|
-
To: example@example.com
|
110
|
-
Subject: Account confirmation
|
111
|
-
Mime-Version: 1.0
|
112
|
-
Content-Type: text/plain; charset=utf-8
|
113
|
-
|
114
|
-
Hello !
|
115
|
-
|
116
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
117
|
-
Rendering welcome/signup
|
118
|
-
Completed in 4ms (View: 0, DB: 1) | 200 OK [http://www.example.com/welcome/signup]
|
119
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
120
|
-
|
121
|
-
|
122
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
123
|
-
Rendering welcome/index
|
124
|
-
Completed in 2ms (View: 1, DB: 1) | 200 OK [http://www.example.com/]
|
125
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
126
|
-
|
127
|
-
|
128
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-16 23:20:07) [POST]
|
129
|
-
Parameters: {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
130
|
-
Sent mail to example@example.com
|
131
|
-
|
132
|
-
Date: Wed, 16 Dec 2009 23:20:07 -0700
|
133
|
-
From: admin@example.com
|
134
|
-
To: example@example.com
|
135
|
-
Subject: Account confirmation
|
136
|
-
Mime-Version: 1.0
|
137
|
-
Content-Type: text/plain; charset=utf-8
|
138
|
-
|
139
|
-
Hello !
|
140
|
-
|
141
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
142
|
-
Rendering welcome/signup
|
143
|
-
Completed in 4ms (View: 0, DB: 1) | 200 OK [http://www.example.com/welcome/signup]
|
144
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
145
|
-
|
146
|
-
|
147
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
148
|
-
Rendering welcome/index
|
149
|
-
Completed in 2ms (View: 1, DB: 1) | 200 OK [http://www.example.com/]
|
150
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
151
|
-
|
152
|
-
|
153
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-16 23:20:07) [POST]
|
154
|
-
Parameters: {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
155
|
-
Sent mail to example@example.com
|
156
|
-
|
157
|
-
Date: Wed, 16 Dec 2009 23:20:07 -0700
|
158
|
-
From: admin@example.com
|
159
|
-
To: example@example.com
|
160
|
-
Subject: Account confirmation
|
161
|
-
Mime-Version: 1.0
|
162
|
-
Content-Type: text/plain; charset=utf-8
|
163
|
-
|
164
|
-
Hello !
|
165
|
-
|
166
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
167
|
-
Rendering welcome/signup
|
168
|
-
Completed in 4ms (View: 1, DB: 1) | 200 OK [http://www.example.com/welcome/signup]
|
169
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
170
|
-
|
171
|
-
|
172
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
173
|
-
Rendering welcome/index
|
174
|
-
Completed in 2ms (View: 1, DB: 1) | 200 OK [http://www.example.com/]
|
175
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
176
|
-
|
177
|
-
|
178
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-16 23:20:07) [POST]
|
179
|
-
Parameters: {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
180
|
-
Sent mail to example@example.com
|
181
|
-
|
182
|
-
Date: Wed, 16 Dec 2009 23:20:07 -0700
|
183
|
-
From: admin@example.com
|
184
|
-
To: example@example.com
|
185
|
-
Subject: Account confirmation
|
186
|
-
Mime-Version: 1.0
|
187
|
-
Content-Type: text/plain; charset=utf-8
|
188
|
-
|
189
|
-
Hello !
|
190
|
-
|
191
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
192
|
-
Rendering welcome/signup
|
193
|
-
Completed in 4ms (View: 0, DB: 1) | 200 OK [http://www.example.com/welcome/signup]
|
194
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
195
|
-
|
196
|
-
|
197
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
198
|
-
Rendering welcome/index
|
199
|
-
Completed in 2ms (View: 1, DB: 1) | 200 OK [http://www.example.com/]
|
200
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
201
|
-
|
202
|
-
|
203
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-16 23:20:07) [POST]
|
204
|
-
Parameters: {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
205
|
-
Sent mail to example@example.com
|
206
|
-
|
207
|
-
Date: Wed, 16 Dec 2009 23:20:07 -0700
|
208
|
-
From: admin@example.com
|
209
|
-
To: example@example.com
|
210
|
-
Subject: Account confirmation
|
211
|
-
Mime-Version: 1.0
|
212
|
-
Content-Type: text/plain; charset=utf-8
|
213
|
-
|
214
|
-
Hello Joe Someone!
|
215
|
-
|
216
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
217
|
-
Rendering welcome/signup
|
218
|
-
Completed in 4ms (View: 0, DB: 0) | 200 OK [http://www.example.com/welcome/signup]
|
219
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/welcome/signup"}
|
220
|
-
|
221
|
-
|
222
|
-
Processing WelcomeController#confirm (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
223
|
-
Rendering welcome/confirm
|
224
|
-
Completed in 1ms (View: 1, DB: 2) | 200 OK [http://www.example.com/confirm]
|
225
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
226
|
-
|
227
|
-
|
228
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
229
|
-
Rendering welcome/index
|
230
|
-
Completed in 2ms (View: 1, DB: 1) | 200 OK [http://www.example.com/]
|
231
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
232
|
-
|
233
|
-
|
234
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-16 23:20:07) [POST]
|
235
|
-
Parameters: {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
236
|
-
Sent mail to example@example.com
|
237
|
-
|
238
|
-
Date: Wed, 16 Dec 2009 23:20:07 -0700
|
239
|
-
From: admin@example.com
|
240
|
-
To: example@example.com
|
241
|
-
Subject: Account confirmation
|
242
|
-
Mime-Version: 1.0
|
243
|
-
Content-Type: text/plain; charset=utf-8
|
244
|
-
|
245
|
-
Hello Joe Someone!
|
246
|
-
|
247
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
248
|
-
Rendering welcome/signup
|
249
|
-
Completed in 4ms (View: 0, DB: 0) | 200 OK [http://www.example.com/welcome/signup]
|
250
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/welcome/signup"}
|
251
|
-
|
252
|
-
|
253
|
-
Processing WelcomeController#confirm (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
254
|
-
Rendering welcome/confirm
|
255
|
-
Completed in 1ms (View: 0, DB: 2) | 200 OK [http://www.example.com/confirm]
|
256
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
257
|
-
|
258
|
-
|
259
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
260
|
-
Rendering welcome/index
|
261
|
-
Completed in 2ms (View: 1, DB: 1) | 200 OK [http://www.example.com/]
|
262
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
263
|
-
|
264
|
-
|
265
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-16 23:20:07) [POST]
|
266
|
-
Parameters: {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
267
|
-
Sent mail to example@example.com
|
268
|
-
|
269
|
-
Date: Wed, 16 Dec 2009 23:20:07 -0700
|
270
|
-
From: admin@example.com
|
271
|
-
To: example@example.com
|
272
|
-
Subject: Account confirmation
|
273
|
-
Mime-Version: 1.0
|
274
|
-
Content-Type: text/plain; charset=utf-8
|
275
|
-
|
276
|
-
Hello Joe Someone!
|
277
|
-
|
278
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
279
|
-
Rendering welcome/signup
|
280
|
-
Completed in 4ms (View: 0, DB: 0) | 200 OK [http://www.example.com/welcome/signup]
|
281
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/welcome/signup"}
|
282
|
-
|
283
|
-
|
284
|
-
Processing WelcomeController#confirm (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
285
|
-
Rendering welcome/confirm
|
286
|
-
Completed in 1ms (View: 0, DB: 1) | 200 OK [http://www.example.com/confirm]
|
287
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
288
|
-
|
289
|
-
|
290
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
291
|
-
Rendering welcome/index
|
292
|
-
Completed in 1ms (View: 1, DB: 0) | 200 OK [http://www.example.com/]
|
293
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
294
|
-
|
295
|
-
|
296
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-16 23:20:07) [POST]
|
297
|
-
Parameters: {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
298
|
-
Sent mail to example@example.com
|
299
|
-
|
300
|
-
Date: Wed, 16 Dec 2009 23:20:07 -0700
|
301
|
-
From: admin@example.com
|
302
|
-
To: example@example.com
|
303
|
-
Subject: Account confirmation
|
304
|
-
Mime-Version: 1.0
|
305
|
-
Content-Type: text/plain; charset=utf-8
|
306
|
-
|
307
|
-
Hello Joe Someone!
|
308
|
-
|
309
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
310
|
-
Rendering welcome/signup
|
311
|
-
Completed in 4ms (View: 0, DB: 0) | 200 OK [http://www.example.com/welcome/signup]
|
312
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/welcome/signup"}
|
313
|
-
|
314
|
-
|
315
|
-
Processing WelcomeController#confirm (for 127.0.0.1 at 2009-12-16 23:20:07) [GET]
|
316
|
-
Rendering welcome/confirm
|
317
|
-
Completed in 1ms (View: 0, DB: 1) | 200 OK [http://www.example.com/confirm]
|
318
|
-
[4;36;1mSQL (0.6ms)[0m [0;1m SELECT name
|
319
|
-
FROM sqlite_master
|
320
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
321
|
-
[0m
|
322
|
-
[4;35;1mSQL (0.2ms)[0m [0mSELECT version FROM schema_migrations[0m
|
323
|
-
Migrating to CreateUsers (20090125013728)
|
324
|
-
Migrating to CreateDelayedJobs (20090908054656)
|
325
|
-
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
326
|
-
[4;35;1mSQL (0.2ms)[0m [0m SELECT name
|
327
|
-
FROM sqlite_master
|
328
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
329
|
-
[0m
|
330
|
-
[4;36;1mSQL (0.2ms)[0m [0;1mSELECT version FROM schema_migrations[0m
|
331
|
-
[4;35;1mSQL (0.3ms)[0m [0m SELECT name
|
332
|
-
FROM sqlite_master
|
333
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
334
|
-
[0m
|
335
|
-
[4;36;1mSQL (0.1ms)[0m [0;1mPRAGMA index_list("delayed_jobs")[0m
|
336
|
-
[4;35;1mSQL (0.0ms)[0m [0mPRAGMA index_list("users")[0m
|
337
|
-
|
338
|
-
|
339
|
-
Processing WelcomeController#signup (for 0.0.0.0 at 2009-12-16 23:20:18) [POST]
|
340
|
-
Parameters: {"Name"=>"Jimmy Bean", "Email"=>"email@example.com"}
|
341
|
-
Rendering welcome/signup
|
342
|
-
Completed in 3ms (View: 0, DB: 0) | 200 OK [http://test.host/welcome/signup?Email=email%40example.com&Name=Jimmy+Bean]
|
343
|
-
[4;36;1mSQL (0.7ms)[0m [0;1m SELECT name
|
344
|
-
FROM sqlite_master
|
345
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
346
|
-
[0m
|
347
|
-
[4;35;1mSQL (0.2ms)[0m [0mSELECT version FROM schema_migrations[0m
|
348
|
-
Migrating to CreateUsers (20090125013728)
|
349
|
-
Migrating to CreateDelayedJobs (20090908054656)
|
350
|
-
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
351
|
-
[4;35;1mSQL (0.3ms)[0m [0m SELECT name
|
352
|
-
FROM sqlite_master
|
353
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
354
|
-
[0m
|
355
|
-
[4;36;1mSQL (0.2ms)[0m [0;1mSELECT version FROM schema_migrations[0m
|
356
|
-
[4;35;1mSQL (0.3ms)[0m [0m SELECT name
|
357
|
-
FROM sqlite_master
|
358
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
359
|
-
[0m
|
360
|
-
[4;36;1mSQL (0.1ms)[0m [0;1mPRAGMA index_list("delayed_jobs")[0m
|
361
|
-
[4;35;1mSQL (0.1ms)[0m [0mPRAGMA index_list("users")[0m
|
362
|
-
REQUESTING PAGE: GET http://www.example.com/newsletter?Email=example%40example.com&Name=Joe+Someone with {} and HTTP headers {}
|
363
|
-
|
364
|
-
|
365
|
-
Processing WelcomeController#newsletter (for 127.0.0.1 at 2009-12-23 18:33:56) [GET]
|
366
|
-
Parameters: {"Name"=>"Joe Someone", "Email"=>"example@example.com"}
|
367
|
-
[4;36;1mDelayed::Job Create (0.4ms)[0m [0;1mINSERT INTO "delayed_jobs" ("locked_by", "updated_at", "handler", "priority", "run_at", "locked_at", "last_error", "attempts", "failed_at", "created_at") VALUES(NULL, '2009-12-24 01:33:56', '--- !ruby/struct:Delayed::PerformableMethod
|
368
|
-
object: CLASS:UserMailer
|
369
|
-
method: :deliver_newsletter
|
370
|
-
args:
|
371
|
-
- example@example.com
|
372
|
-
- Joe Someone
|
373
|
-
', 0, '2009-12-24 01:33:56', NULL, NULL, 0, NULL, '2009-12-24 01:33:56')[0m
|
374
|
-
Rendering welcome/newsletter
|
375
|
-
Completed in 281ms (View: 3, DB: 20) | 200 OK [http://www.example.com/newsletter?Email=example%40example.com&Name=Joe+Someone]
|
376
|
-
* [JOB] acquiring lock on UserMailer.deliver_newsletter
|
377
|
-
[4;35;1mDelayed::Job Update (0.1ms)[0m [0mUPDATE "delayed_jobs" SET locked_at = '2009-12-24 01:33:56', locked_by = 'host:Benz pid:5059' WHERE (id = 1 and (locked_at is null or locked_at < '2009-12-23 21:33:56') and (run_at <= '2009-12-24 01:33:56')) [0m
|
378
|
-
Sent mail to example@example.com
|
379
|
-
|
380
|
-
Date: Wed, 23 Dec 2009 18:33:56 -0700
|
381
|
-
From: admin@example.com
|
382
|
-
To: example@example.com
|
383
|
-
Subject: Newsletter sent
|
384
|
-
Mime-Version: 1.0
|
385
|
-
Content-Type: text/plain; charset=utf-8
|
386
|
-
|
387
|
-
Hello Joe Someone!
|
388
|
-
|
389
|
-
This week.....
|
390
|
-
.....
|
391
|
-
.....
|
392
|
-
|
393
|
-
Regards
|
394
|
-
Rails Example App
|
395
|
-
[4;36;1mDelayed::Job Destroy (0.1ms)[0m [0;1mDELETE FROM "delayed_jobs" WHERE "id" = 1[0m
|
396
|
-
* [JOB] UserMailer.deliver_newsletter completed after 0.0048
|
397
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
398
|
-
|
399
|
-
|
400
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-23 18:33:56) [GET]
|
401
|
-
Rendering welcome/index
|
402
|
-
Completed in 2ms (View: 2, DB: 2) | 200 OK [http://www.example.com/]
|
403
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
404
|
-
|
405
|
-
|
406
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-23 18:33:56) [POST]
|
407
|
-
Parameters: {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
408
|
-
Sent mail to example@example.com
|
409
|
-
|
410
|
-
Date: Wed, 23 Dec 2009 18:33:56 -0700
|
411
|
-
From: admin@example.com
|
412
|
-
To: example@example.com
|
413
|
-
Subject: Account confirmation
|
414
|
-
Mime-Version: 1.0
|
415
|
-
Content-Type: text/plain; charset=utf-8
|
416
|
-
|
417
|
-
Hello !
|
418
|
-
|
419
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
420
|
-
Rendering welcome/signup
|
421
|
-
Completed in 5ms (View: 1, DB: 1) | 200 OK [http://www.example.com/welcome/signup]
|
422
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
423
|
-
|
424
|
-
|
425
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-23 18:33:56) [GET]
|
426
|
-
Rendering welcome/index
|
427
|
-
Completed in 2ms (View: 2, DB: 103) | 200 OK [http://www.example.com/]
|
428
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
429
|
-
|
430
|
-
|
431
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-23 18:33:56) [POST]
|
432
|
-
Parameters: {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
433
|
-
Sent mail to example@example.com
|
434
|
-
|
435
|
-
Date: Wed, 23 Dec 2009 18:33:56 -0700
|
436
|
-
From: admin@example.com
|
437
|
-
To: example@example.com
|
438
|
-
Subject: Account confirmation
|
439
|
-
Mime-Version: 1.0
|
440
|
-
Content-Type: text/plain; charset=utf-8
|
441
|
-
|
442
|
-
Hello !
|
443
|
-
|
444
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
445
|
-
Rendering welcome/signup
|
446
|
-
Completed in 5ms (View: 0, DB: 2) | 200 OK [http://www.example.com/welcome/signup]
|
447
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
448
|
-
|
449
|
-
|
450
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-23 18:33:57) [GET]
|
451
|
-
Rendering welcome/index
|
452
|
-
Completed in 2ms (View: 1, DB: 318) | 200 OK [http://www.example.com/]
|
453
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
454
|
-
|
455
|
-
|
456
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-23 18:33:57) [POST]
|
457
|
-
Parameters: {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
458
|
-
Sent mail to example@example.com
|
459
|
-
|
460
|
-
Date: Wed, 23 Dec 2009 18:33:57 -0700
|
461
|
-
From: admin@example.com
|
462
|
-
To: example@example.com
|
463
|
-
Subject: Account confirmation
|
464
|
-
Mime-Version: 1.0
|
465
|
-
Content-Type: text/plain; charset=utf-8
|
466
|
-
|
467
|
-
Hello !
|
468
|
-
|
469
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
470
|
-
Rendering welcome/signup
|
471
|
-
Completed in 5ms (View: 1, DB: 1) | 200 OK [http://www.example.com/welcome/signup]
|
472
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
473
|
-
|
474
|
-
|
475
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-23 18:33:57) [GET]
|
476
|
-
Rendering welcome/index
|
477
|
-
Completed in 2ms (View: 2, DB: 1) | 200 OK [http://www.example.com/]
|
478
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
479
|
-
|
480
|
-
|
481
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-23 18:33:57) [POST]
|
482
|
-
Parameters: {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
483
|
-
Sent mail to example@example.com
|
484
|
-
|
485
|
-
Date: Wed, 23 Dec 2009 18:33:57 -0700
|
486
|
-
From: admin@example.com
|
487
|
-
To: example@example.com
|
488
|
-
Subject: Account confirmation
|
489
|
-
Mime-Version: 1.0
|
490
|
-
Content-Type: text/plain; charset=utf-8
|
491
|
-
|
492
|
-
Hello !
|
493
|
-
|
494
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
495
|
-
Rendering welcome/signup
|
496
|
-
Completed in 4ms (View: 0, DB: 1) | 200 OK [http://www.example.com/welcome/signup]
|
497
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
498
|
-
|
499
|
-
|
500
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-23 18:33:57) [GET]
|
501
|
-
Rendering welcome/index
|
502
|
-
Completed in 2ms (View: 2, DB: 1) | 200 OK [http://www.example.com/]
|
503
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
504
|
-
|
505
|
-
|
506
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-23 18:33:57) [POST]
|
507
|
-
Parameters: {"Name"=>"", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
508
|
-
Sent mail to example@example.com
|
509
|
-
|
510
|
-
Date: Wed, 23 Dec 2009 18:33:57 -0700
|
511
|
-
From: admin@example.com
|
512
|
-
To: example@example.com
|
513
|
-
Subject: Account confirmation
|
514
|
-
Mime-Version: 1.0
|
515
|
-
Content-Type: text/plain; charset=utf-8
|
516
|
-
|
517
|
-
Hello !
|
518
|
-
|
519
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
520
|
-
Rendering welcome/signup
|
521
|
-
Completed in 4ms (View: 1, DB: 1) | 200 OK [http://www.example.com/welcome/signup]
|
522
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
523
|
-
|
524
|
-
|
525
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-23 18:33:57) [GET]
|
526
|
-
Rendering welcome/index
|
527
|
-
Completed in 2ms (View: 1, DB: 1) | 200 OK [http://www.example.com/]
|
528
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
529
|
-
|
530
|
-
|
531
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-23 18:33:57) [POST]
|
532
|
-
Parameters: {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
533
|
-
Sent mail to example@example.com
|
534
|
-
|
535
|
-
Date: Wed, 23 Dec 2009 18:33:57 -0700
|
536
|
-
From: admin@example.com
|
537
|
-
To: example@example.com
|
538
|
-
Subject: Account confirmation
|
539
|
-
Mime-Version: 1.0
|
540
|
-
Content-Type: text/plain; charset=utf-8
|
541
|
-
|
542
|
-
Hello Joe Someone!
|
543
|
-
|
544
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
545
|
-
Rendering welcome/signup
|
546
|
-
Completed in 4ms (View: 0, DB: 0) | 200 OK [http://www.example.com/welcome/signup]
|
547
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/welcome/signup"}
|
548
|
-
|
549
|
-
|
550
|
-
Processing WelcomeController#confirm (for 127.0.0.1 at 2009-12-23 18:33:57) [GET]
|
551
|
-
Rendering welcome/confirm
|
552
|
-
Completed in 2ms (View: 1, DB: 2) | 200 OK [http://www.example.com/confirm]
|
553
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
554
|
-
|
555
|
-
|
556
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-23 18:33:57) [GET]
|
557
|
-
Rendering welcome/index
|
558
|
-
Completed in 2ms (View: 1, DB: 1) | 200 OK [http://www.example.com/]
|
559
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
560
|
-
|
561
|
-
|
562
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-23 18:33:57) [POST]
|
563
|
-
Parameters: {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
564
|
-
Sent mail to example@example.com
|
565
|
-
|
566
|
-
Date: Wed, 23 Dec 2009 18:33:57 -0700
|
567
|
-
From: admin@example.com
|
568
|
-
To: example@example.com
|
569
|
-
Subject: Account confirmation
|
570
|
-
Mime-Version: 1.0
|
571
|
-
Content-Type: text/plain; charset=utf-8
|
572
|
-
|
573
|
-
Hello Joe Someone!
|
574
|
-
|
575
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
576
|
-
Rendering welcome/signup
|
577
|
-
Completed in 4ms (View: 1, DB: 0) | 200 OK [http://www.example.com/welcome/signup]
|
578
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/welcome/signup"}
|
579
|
-
|
580
|
-
|
581
|
-
Processing WelcomeController#confirm (for 127.0.0.1 at 2009-12-23 18:33:57) [GET]
|
582
|
-
Rendering welcome/confirm
|
583
|
-
Completed in 1ms (View: 0, DB: 2) | 200 OK [http://www.example.com/confirm]
|
584
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
585
|
-
|
586
|
-
|
587
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-23 18:33:57) [GET]
|
588
|
-
Rendering welcome/index
|
589
|
-
Completed in 2ms (View: 1, DB: 1) | 200 OK [http://www.example.com/]
|
590
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
591
|
-
|
592
|
-
|
593
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-23 18:33:57) [POST]
|
594
|
-
Parameters: {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
595
|
-
Sent mail to example@example.com
|
596
|
-
|
597
|
-
Date: Wed, 23 Dec 2009 18:33:57 -0700
|
598
|
-
From: admin@example.com
|
599
|
-
To: example@example.com
|
600
|
-
Subject: Account confirmation
|
601
|
-
Mime-Version: 1.0
|
602
|
-
Content-Type: text/plain; charset=utf-8
|
603
|
-
|
604
|
-
Hello Joe Someone!
|
605
|
-
|
606
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
607
|
-
Rendering welcome/signup
|
608
|
-
Completed in 4ms (View: 0, DB: 0) | 200 OK [http://www.example.com/welcome/signup]
|
609
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/welcome/signup"}
|
610
|
-
|
611
|
-
|
612
|
-
Processing WelcomeController#confirm (for 127.0.0.1 at 2009-12-23 18:33:57) [GET]
|
613
|
-
Rendering welcome/confirm
|
614
|
-
Completed in 1ms (View: 0, DB: 1) | 200 OK [http://www.example.com/confirm]
|
615
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
616
|
-
|
617
|
-
|
618
|
-
Processing WelcomeController#index (for 127.0.0.1 at 2009-12-23 18:33:57) [GET]
|
619
|
-
Rendering welcome/index
|
620
|
-
Completed in 2ms (View: 1, DB: 1) | 200 OK [http://www.example.com/]
|
621
|
-
REQUESTING PAGE: POST /welcome/signup with {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
622
|
-
|
623
|
-
|
624
|
-
Processing WelcomeController#signup (for 127.0.0.1 at 2009-12-23 18:33:57) [POST]
|
625
|
-
Parameters: {"Name"=>"Joe Someone", "commit"=>"Sign up", "Email"=>"example@example.com"}
|
626
|
-
Sent mail to example@example.com
|
627
|
-
|
628
|
-
Date: Wed, 23 Dec 2009 18:33:57 -0700
|
629
|
-
From: admin@example.com
|
630
|
-
To: example@example.com
|
631
|
-
Subject: Account confirmation
|
632
|
-
Mime-Version: 1.0
|
633
|
-
Content-Type: text/plain; charset=utf-8
|
634
|
-
|
635
|
-
Hello Joe Someone!
|
636
|
-
|
637
|
-
<a href="http://example.com/confirm">Click here to confirm your account!</a>
|
638
|
-
Rendering welcome/signup
|
639
|
-
Completed in 6ms (View: 0, DB: 0) | 200 OK [http://www.example.com/welcome/signup]
|
640
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/welcome/signup"}
|
641
|
-
|
642
|
-
|
643
|
-
Processing WelcomeController#confirm (for 127.0.0.1 at 2009-12-23 18:33:57) [GET]
|
644
|
-
Rendering welcome/confirm
|
645
|
-
Completed in 1ms (View: 0, DB: 1) | 200 OK [http://www.example.com/confirm]
|
646
|
-
[4;36;1mSQL (0.6ms)[0m [0;1m SELECT name
|
647
|
-
FROM sqlite_master
|
648
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
649
|
-
[0m
|
650
|
-
[4;35;1mSQL (0.2ms)[0m [0mSELECT version FROM schema_migrations[0m
|
651
|
-
Migrating to CreateUsers (20090125013728)
|
652
|
-
Migrating to CreateDelayedJobs (20090908054656)
|
653
|
-
[4;36;1mSQL (0.2ms)[0m [0;1mselect sqlite_version(*)[0m
|
654
|
-
[4;35;1mSQL (0.3ms)[0m [0m SELECT name
|
655
|
-
FROM sqlite_master
|
656
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
657
|
-
[0m
|
658
|
-
[4;36;1mSQL (0.2ms)[0m [0;1mSELECT version FROM schema_migrations[0m
|
659
|
-
[4;35;1mSQL (0.2ms)[0m [0m SELECT name
|
660
|
-
FROM sqlite_master
|
661
|
-
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
662
|
-
[0m
|
663
|
-
[4;36;1mSQL (0.1ms)[0m [0;1mPRAGMA index_list("delayed_jobs")[0m
|
664
|
-
[4;35;1mSQL (0.1ms)[0m [0mPRAGMA index_list("users")[0m
|
665
|
-
|
666
|
-
|
667
|
-
Processing WelcomeController#signup (for 0.0.0.0 at 2009-12-23 18:34:08) [POST]
|
668
|
-
Parameters: {"Name"=>"Jimmy Bean", "Email"=>"email@example.com"}
|
669
|
-
Rendering welcome/signup
|
670
|
-
Completed in 2ms (View: 0, DB: 0) | 200 OK [http://test.host/welcome/signup?Email=email%40example.com&Name=Jimmy+Bean]
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# This generator adds email steps to the step definitions directory
|
2
|
-
generator_base = defined?(Rails) ? Rails::Generator::Base : RubiGen::Base
|
3
|
-
class EmailSpecGenerator < generator_base
|
4
|
-
def manifest
|
5
|
-
record do |m|
|
6
|
-
m.directory 'features/step_definitions'
|
7
|
-
m.file 'email_steps.rb', 'features/step_definitions/email_steps.rb'
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
protected
|
12
|
-
|
13
|
-
def banner
|
14
|
-
"Usage: #{$0} email_spec"
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
@@ -1,143 +0,0 @@
|
|
1
|
-
# Commonly used email steps
|
2
|
-
#
|
3
|
-
# To add your own steps make a custom_email_steps.rb
|
4
|
-
# The provided methods are:
|
5
|
-
#
|
6
|
-
# last_email_address
|
7
|
-
# reset_mailer
|
8
|
-
# open_last_email
|
9
|
-
# visit_in_email
|
10
|
-
# unread_emails_for
|
11
|
-
# mailbox_for
|
12
|
-
# current_email
|
13
|
-
# open_email
|
14
|
-
# read_emails_for
|
15
|
-
# find_email
|
16
|
-
#
|
17
|
-
# General form for email scenarios are:
|
18
|
-
# - clear the email queue (done automatically by email_spec)
|
19
|
-
# - execute steps that sends an email
|
20
|
-
# - check the user received an/no/[0-9] emails
|
21
|
-
# - open the email
|
22
|
-
# - inspect the email contents
|
23
|
-
# - interact with the email (e.g. click links)
|
24
|
-
#
|
25
|
-
# The Cucumber steps below are setup in this order.
|
26
|
-
|
27
|
-
module EmailHelpers
|
28
|
-
def current_email_address
|
29
|
-
# Replace with your a way to find your current email. e.g @current_user.email
|
30
|
-
# last_email_address will return the last email address used by email spec to find an email.
|
31
|
-
# Note that last_email_address will be reset after each Scenario.
|
32
|
-
last_email_address || "example@example.com"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
World(EmailHelpers)
|
37
|
-
|
38
|
-
#
|
39
|
-
# Reset the e-mail queue within a scenario.
|
40
|
-
# This is done automatically before each scenario.
|
41
|
-
#
|
42
|
-
|
43
|
-
Given /^(?:a clear email queue|no emails have been sent)$/ do
|
44
|
-
reset_mailer
|
45
|
-
end
|
46
|
-
|
47
|
-
#
|
48
|
-
# Check how many emails have been sent/received
|
49
|
-
#
|
50
|
-
|
51
|
-
Then /^(?:I|they|"([^"]*?)") should receive (an|no|\d+) emails?$/ do |address, amount|
|
52
|
-
unread_emails_for(address).size.should == parse_email_count(amount)
|
53
|
-
end
|
54
|
-
|
55
|
-
Then /^(?:I|they|"([^"]*?)") should have (an|no|\d+) emails?$/ do |address, amount|
|
56
|
-
mailbox_for(address).size.should == parse_email_count(amount)
|
57
|
-
end
|
58
|
-
|
59
|
-
# DEPRECATED
|
60
|
-
# The following methods are left in for backwards compatibility and
|
61
|
-
# should be removed by version 0.4.0
|
62
|
-
Then /^(?:I|they|"([^"]*?)") should not receive an email$/ do |address|
|
63
|
-
email_spec_deprecate "The step 'I/they/[email] should not receive an email' is no longer supported.
|
64
|
-
Please use 'I/they/[email] should receive no emails' instead."
|
65
|
-
unread_emails_for(address).size.should == 0
|
66
|
-
end
|
67
|
-
|
68
|
-
#
|
69
|
-
# Accessing emails
|
70
|
-
#
|
71
|
-
|
72
|
-
# Opens the most recently received email
|
73
|
-
When /^(?:I|they|"([^"]*?)") opens? the email$/ do |address|
|
74
|
-
open_email(address)
|
75
|
-
end
|
76
|
-
|
77
|
-
When /^(?:I|they|"([^"]*?)") opens? the email with subject "([^"]*?)"$/ do |address, subject|
|
78
|
-
open_email(address, :with_subject => subject)
|
79
|
-
end
|
80
|
-
|
81
|
-
When /^(?:I|they|"([^"]*?)") opens? the email with text "([^"]*?)"$/ do |address, text|
|
82
|
-
open_email(address, :with_text => text)
|
83
|
-
end
|
84
|
-
|
85
|
-
#
|
86
|
-
# Inspect the Email Contents
|
87
|
-
#
|
88
|
-
|
89
|
-
Then /^(?:I|they) should see "([^"]*?)" in the email subject$/ do |text|
|
90
|
-
current_email.should have_subject(text)
|
91
|
-
end
|
92
|
-
|
93
|
-
Then /^(?:I|they) should see \/([^"]*?)\/ in the email subject$/ do |text|
|
94
|
-
current_email.should have_subject(Regexp.new(text))
|
95
|
-
end
|
96
|
-
|
97
|
-
Then /^(?:I|they) should see "([^"]*?)" in the email body$/ do |text|
|
98
|
-
current_email.body.should include(text)
|
99
|
-
end
|
100
|
-
|
101
|
-
Then /^(?:I|they) should see \/([^"]*?)\/ in the email body$/ do |text|
|
102
|
-
current_email.body.should =~ Regexp.new(text)
|
103
|
-
end
|
104
|
-
|
105
|
-
Then /^(?:I|they) should see the email delivered from "([^"]*?)"$/ do |text|
|
106
|
-
current_email.should be_delivered_from(text)
|
107
|
-
end
|
108
|
-
|
109
|
-
Then /^(?:I|they) should see "([^\"]*)" in the email "([^"]*?)" header$/ do |text, name|
|
110
|
-
current_email.should have_header(name, text)
|
111
|
-
end
|
112
|
-
|
113
|
-
Then /^(?:I|they) should see \/([^\"]*)\/ in the email "([^"]*?)" header$/ do |text, name|
|
114
|
-
current_email.should have_header(name, Regexp.new(text))
|
115
|
-
end
|
116
|
-
|
117
|
-
|
118
|
-
# DEPRECATED
|
119
|
-
# The following methods are left in for backwards compatibility and
|
120
|
-
# should be removed by version 0.4.0.
|
121
|
-
Then /^(?:I|they) should see "([^"]*?)" in the subject$/ do |text|
|
122
|
-
email_spec_deprecate "The step 'I/they should see [text] in the subject' is no longer supported.
|
123
|
-
Please use 'I/they should see [text] in the email subject' instead."
|
124
|
-
current_email.should have_subject(Regexp.new(text))
|
125
|
-
end
|
126
|
-
Then /^(?:I|they) should see "([^"]*?)" in the email$/ do |text|
|
127
|
-
email_spec_deprecate "The step 'I/they should see [text] in the email' is no longer supported.
|
128
|
-
Please use 'I/they should see [text] in the email body' instead."
|
129
|
-
current_email.body.should =~ Regexp.new(text)
|
130
|
-
end
|
131
|
-
|
132
|
-
#
|
133
|
-
# Interact with Email Contents
|
134
|
-
#
|
135
|
-
|
136
|
-
When /^(?:I|they) follow "([^"]*?)" in the email$/ do |link|
|
137
|
-
visit_in_email(link)
|
138
|
-
end
|
139
|
-
|
140
|
-
When /^(?:I|they) click the first link in the email$/ do
|
141
|
-
click_first_link_in_email
|
142
|
-
end
|
143
|
-
|
data/examples/sinatra/webrat.log
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# Logfile created on Wed Dec 16 23:20:14 -0700 2009 by /
|
2
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
3
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>nil, "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
4
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
5
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>nil, "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
6
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
7
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>nil, "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
8
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
9
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>nil, "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
10
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
11
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>nil, "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
12
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
13
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>"Joe Someone", "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
14
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/signup"}
|
15
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
16
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>"Joe Someone", "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
17
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/signup"}
|
18
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
19
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>"Joe Someone", "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
20
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/signup"}
|
21
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
22
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>"Joe Someone", "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
23
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/signup"}
|
24
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
25
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>nil, "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
26
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
27
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>nil, "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
28
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
29
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>nil, "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
30
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
31
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>nil, "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
32
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
33
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>nil, "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
34
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
35
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>"Joe Someone", "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
36
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/signup"}
|
37
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
38
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>"Joe Someone", "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
39
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/signup"}
|
40
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
41
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>"Joe Someone", "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
42
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/signup"}
|
43
|
-
REQUESTING PAGE: GET / with {} and HTTP headers {}
|
44
|
-
REQUESTING PAGE: POST /signup with {"user[name]"=>"Joe Someone", "user[email]"=>"example@example.com"} and HTTP headers {"HTTP_REFERER"=>"/"}
|
45
|
-
REQUESTING PAGE: GET /confirm with {} and HTTP headers {"HTTP_REFERER"=>"/signup"}
|