delayed_mailhopper 0.0.4 → 0.0.5
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/lib/delayed_mailhopper/version.rb +1 -1
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/sample_mailer.rb +8 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/sample_mailer/hello.text.erb +1 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +42 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +27 -0
- data/spec/dummy/config/environments/production.rb +51 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/delayed_job.rb +1 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mailhopper.rb +3 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +58 -0
- data/spec/dummy/db/migrate/20110804223859_create_emails.rb +21 -0
- data/spec/dummy/db/migrate/20110804224806_create_delayed_jobs.rb +21 -0
- data/spec/dummy/db/migrate/20120209150616_add_queue_to_delayed_jobs.rb +9 -0
- data/spec/dummy/db/schema.rb +45 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +126 -0
- data/spec/dummy/log/test.log +833 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/delayed_job +5 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/models/email_spec.rb +64 -0
- data/spec/spec_helper.rb +32 -0
- metadata +96 -15
- data/lib/tasks/delayed_mailhopper_tasks.rake +0 -4
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Email" do
|
4
|
+
let(:email) { DelayedMailhopper::Email.new }
|
5
|
+
|
6
|
+
it "should require a from address" do
|
7
|
+
assert !email.valid?
|
8
|
+
email.from_address = 'user@example.com'
|
9
|
+
assert email.valid?
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "generated by a mailer" do
|
13
|
+
let(:headers) {{
|
14
|
+
:from => 'from@example.com',
|
15
|
+
:to => 'to@example.com',
|
16
|
+
:cc => 'cc@example.com',
|
17
|
+
:bcc => 'bcc@example.com',
|
18
|
+
:reply_to => 'reply_to@example.com',
|
19
|
+
:subject => 'Hiya!'
|
20
|
+
}}
|
21
|
+
let(:content) { 'Papaya' }
|
22
|
+
|
23
|
+
before do
|
24
|
+
SampleMailer.hello(headers, content).deliver
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should match the intended headers and content" do
|
28
|
+
email = DelayedMailhopper::Email.first
|
29
|
+
assert_equal email.from_address, headers[:from]
|
30
|
+
assert_equal email.to_address, headers[:to]
|
31
|
+
assert_equal email.cc_address, headers[:cc]
|
32
|
+
assert_equal email.bcc_address, headers[:bcc]
|
33
|
+
assert_equal email.reply_to_address, headers[:reply_to]
|
34
|
+
assert_equal email.subject, headers[:subject]
|
35
|
+
|
36
|
+
# Email content will include headers as well as content
|
37
|
+
assert email.content.include?(content)
|
38
|
+
|
39
|
+
assert email.sent_at.nil?
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should be queued as a delayed job" do
|
43
|
+
assert_equal DelayedMailhopper::Email.count, 1
|
44
|
+
assert_equal Delayed::Job.count, 1
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should be delivered via DelayedJob" do
|
48
|
+
email = DelayedMailhopper::Email.first
|
49
|
+
assert email.sent_at.nil?
|
50
|
+
|
51
|
+
Delayed::Job.first.invoke_job
|
52
|
+
|
53
|
+
email.reload
|
54
|
+
assert !email.sent_at.nil?
|
55
|
+
end
|
56
|
+
|
57
|
+
it "should be marked as sent once delivered" do
|
58
|
+
email = DelayedMailhopper::Email.first
|
59
|
+
assert email.sent_at.nil?
|
60
|
+
email.send!
|
61
|
+
assert !email.sent_at.nil?
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require File.expand_path("../../spec/dummy/config/environment", __FILE__)
|
4
|
+
require 'rspec/rails'
|
5
|
+
require 'rspec/autorun'
|
6
|
+
|
7
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
8
|
+
# in spec/support/ and its subdirectories.
|
9
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
10
|
+
|
11
|
+
RSpec.configure do |config|
|
12
|
+
# ## Mock Framework
|
13
|
+
#
|
14
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
15
|
+
#
|
16
|
+
# config.mock_with :mocha
|
17
|
+
# config.mock_with :flexmock
|
18
|
+
# config.mock_with :rr
|
19
|
+
|
20
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
21
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
22
|
+
|
23
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
24
|
+
# examples within a transaction, remove the following line or assign false
|
25
|
+
# instead of true.
|
26
|
+
config.use_transactional_fixtures = true
|
27
|
+
|
28
|
+
# If true, the base class of anonymous controllers will be inferred
|
29
|
+
# automatically. This will be the default behavior in future versions of
|
30
|
+
# rspec-rails.
|
31
|
+
config.infer_base_class_for_anonymous_controllers = false
|
32
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: delayed_mailhopper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mailhopper
|
16
|
-
requirement: &
|
16
|
+
requirement: &70195877838020 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 0.0.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70195877838020
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: delayed_job
|
27
|
-
requirement: &
|
27
|
+
requirement: &70195877837360 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70195877837360
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sqlite3
|
38
|
-
requirement: &
|
38
|
+
requirement: &70195877836440 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.3.4
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70195877836440
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec-rails
|
49
|
-
requirement: &
|
49
|
+
requirement: &70195877836000 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70195877836000
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: delayed_job_active_record
|
60
|
-
requirement: &
|
60
|
+
requirement: &70195877835340 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70195877835340
|
69
69
|
description: DelayedMailhopper extends Mailhopper to deliver emails asynchronously
|
70
70
|
with DelayedJob.
|
71
71
|
email:
|
@@ -80,10 +80,50 @@ files:
|
|
80
80
|
- lib/delayed_mailhopper/engine.rb
|
81
81
|
- lib/delayed_mailhopper/version.rb
|
82
82
|
- lib/delayed_mailhopper.rb
|
83
|
-
- lib/tasks/delayed_mailhopper_tasks.rake
|
84
83
|
- MIT-LICENSE
|
85
84
|
- Rakefile
|
86
85
|
- README.md
|
86
|
+
- spec/dummy/app/assets/javascripts/application.js
|
87
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
88
|
+
- spec/dummy/app/controllers/application_controller.rb
|
89
|
+
- spec/dummy/app/helpers/application_helper.rb
|
90
|
+
- spec/dummy/app/mailers/sample_mailer.rb
|
91
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
92
|
+
- spec/dummy/app/views/sample_mailer/hello.text.erb
|
93
|
+
- spec/dummy/config/application.rb
|
94
|
+
- spec/dummy/config/boot.rb
|
95
|
+
- spec/dummy/config/database.yml
|
96
|
+
- spec/dummy/config/environment.rb
|
97
|
+
- spec/dummy/config/environments/development.rb
|
98
|
+
- spec/dummy/config/environments/production.rb
|
99
|
+
- spec/dummy/config/environments/test.rb
|
100
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
101
|
+
- spec/dummy/config/initializers/delayed_job.rb
|
102
|
+
- spec/dummy/config/initializers/inflections.rb
|
103
|
+
- spec/dummy/config/initializers/mailhopper.rb
|
104
|
+
- spec/dummy/config/initializers/mime_types.rb
|
105
|
+
- spec/dummy/config/initializers/secret_token.rb
|
106
|
+
- spec/dummy/config/initializers/session_store.rb
|
107
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
108
|
+
- spec/dummy/config/locales/en.yml
|
109
|
+
- spec/dummy/config/routes.rb
|
110
|
+
- spec/dummy/config.ru
|
111
|
+
- spec/dummy/db/migrate/20110804223859_create_emails.rb
|
112
|
+
- spec/dummy/db/migrate/20110804224806_create_delayed_jobs.rb
|
113
|
+
- spec/dummy/db/migrate/20120209150616_add_queue_to_delayed_jobs.rb
|
114
|
+
- spec/dummy/db/schema.rb
|
115
|
+
- spec/dummy/db/test.sqlite3
|
116
|
+
- spec/dummy/log/development.log
|
117
|
+
- spec/dummy/log/test.log
|
118
|
+
- spec/dummy/public/404.html
|
119
|
+
- spec/dummy/public/422.html
|
120
|
+
- spec/dummy/public/500.html
|
121
|
+
- spec/dummy/public/favicon.ico
|
122
|
+
- spec/dummy/Rakefile
|
123
|
+
- spec/dummy/script/delayed_job
|
124
|
+
- spec/dummy/script/rails
|
125
|
+
- spec/models/email_spec.rb
|
126
|
+
- spec/spec_helper.rb
|
87
127
|
homepage: https://github.com/cerebris/delayed_mailhopper
|
88
128
|
licenses: []
|
89
129
|
post_install_message:
|
@@ -109,5 +149,46 @@ signing_key:
|
|
109
149
|
specification_version: 3
|
110
150
|
summary: A simple solution that uses ActiveRecord and DelayedJob to queue, deliver
|
111
151
|
and archive emails in Rails apps.
|
112
|
-
test_files:
|
152
|
+
test_files:
|
153
|
+
- spec/dummy/app/assets/javascripts/application.js
|
154
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
155
|
+
- spec/dummy/app/controllers/application_controller.rb
|
156
|
+
- spec/dummy/app/helpers/application_helper.rb
|
157
|
+
- spec/dummy/app/mailers/sample_mailer.rb
|
158
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
159
|
+
- spec/dummy/app/views/sample_mailer/hello.text.erb
|
160
|
+
- spec/dummy/config/application.rb
|
161
|
+
- spec/dummy/config/boot.rb
|
162
|
+
- spec/dummy/config/database.yml
|
163
|
+
- spec/dummy/config/environment.rb
|
164
|
+
- spec/dummy/config/environments/development.rb
|
165
|
+
- spec/dummy/config/environments/production.rb
|
166
|
+
- spec/dummy/config/environments/test.rb
|
167
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
168
|
+
- spec/dummy/config/initializers/delayed_job.rb
|
169
|
+
- spec/dummy/config/initializers/inflections.rb
|
170
|
+
- spec/dummy/config/initializers/mailhopper.rb
|
171
|
+
- spec/dummy/config/initializers/mime_types.rb
|
172
|
+
- spec/dummy/config/initializers/secret_token.rb
|
173
|
+
- spec/dummy/config/initializers/session_store.rb
|
174
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
175
|
+
- spec/dummy/config/locales/en.yml
|
176
|
+
- spec/dummy/config/routes.rb
|
177
|
+
- spec/dummy/config.ru
|
178
|
+
- spec/dummy/db/migrate/20110804223859_create_emails.rb
|
179
|
+
- spec/dummy/db/migrate/20110804224806_create_delayed_jobs.rb
|
180
|
+
- spec/dummy/db/migrate/20120209150616_add_queue_to_delayed_jobs.rb
|
181
|
+
- spec/dummy/db/schema.rb
|
182
|
+
- spec/dummy/db/test.sqlite3
|
183
|
+
- spec/dummy/log/development.log
|
184
|
+
- spec/dummy/log/test.log
|
185
|
+
- spec/dummy/public/404.html
|
186
|
+
- spec/dummy/public/422.html
|
187
|
+
- spec/dummy/public/500.html
|
188
|
+
- spec/dummy/public/favicon.ico
|
189
|
+
- spec/dummy/Rakefile
|
190
|
+
- spec/dummy/script/delayed_job
|
191
|
+
- spec/dummy/script/rails
|
192
|
+
- spec/models/email_spec.rb
|
193
|
+
- spec/spec_helper.rb
|
113
194
|
has_rdoc:
|