delayed_mailhopper 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/README.md +77 -0
  2. data/Rakefile +4 -29
  3. data/lib/delayed_mailhopper/version.rb +1 -1
  4. metadata +67 -171
  5. data/README.rdoc +0 -35
  6. data/test/delayed_mailhopper_test.rb +0 -7
  7. data/test/dummy/Rakefile +0 -7
  8. data/test/dummy/app/assets/javascripts/application.js +0 -9
  9. data/test/dummy/app/assets/stylesheets/application.css +0 -7
  10. data/test/dummy/app/controllers/application_controller.rb +0 -3
  11. data/test/dummy/app/helpers/application_helper.rb +0 -2
  12. data/test/dummy/app/mailers/sample_mailer.rb +0 -8
  13. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  14. data/test/dummy/app/views/sample_mailer/hello.text.erb +0 -1
  15. data/test/dummy/config/application.rb +0 -42
  16. data/test/dummy/config/boot.rb +0 -10
  17. data/test/dummy/config/database.yml +0 -25
  18. data/test/dummy/config/environment.rb +0 -5
  19. data/test/dummy/config/environments/development.rb +0 -27
  20. data/test/dummy/config/environments/production.rb +0 -51
  21. data/test/dummy/config/environments/test.rb +0 -39
  22. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  23. data/test/dummy/config/initializers/inflections.rb +0 -10
  24. data/test/dummy/config/initializers/mailhopper.rb +0 -3
  25. data/test/dummy/config/initializers/mime_types.rb +0 -5
  26. data/test/dummy/config/initializers/secret_token.rb +0 -7
  27. data/test/dummy/config/initializers/session_store.rb +0 -8
  28. data/test/dummy/config/initializers/wrap_parameters.rb +0 -12
  29. data/test/dummy/config/locales/en.yml +0 -5
  30. data/test/dummy/config/routes.rb +0 -58
  31. data/test/dummy/config.ru +0 -4
  32. data/test/dummy/db/development.sqlite3 +0 -0
  33. data/test/dummy/db/migrate/20110804223859_create_emails.rb +0 -21
  34. data/test/dummy/db/migrate/20110804224806_create_delayed_jobs.rb +0 -21
  35. data/test/dummy/db/schema.rb +0 -43
  36. data/test/dummy/db/test.sqlite3 +0 -0
  37. data/test/dummy/log/development.log +0 -18
  38. data/test/dummy/log/test.log +0 -1571
  39. data/test/dummy/public/404.html +0 -26
  40. data/test/dummy/public/422.html +0 -26
  41. data/test/dummy/public/500.html +0 -26
  42. data/test/dummy/public/favicon.ico +0 -0
  43. data/test/dummy/script/delayed_job +0 -5
  44. data/test/dummy/script/rails +0 -6
  45. data/test/integration/navigation_test.rb +0 -10
  46. data/test/test_helper.rb +0 -14
  47. data/test/unit/email_test.rb +0 -67
@@ -1,26 +0,0 @@
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>
@@ -1,26 +0,0 @@
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>
@@ -1,26 +0,0 @@
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
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment'))
4
- require 'delayed/command'
5
- Delayed::Command.new(ARGV).daemonize
@@ -1,6 +0,0 @@
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'
@@ -1,10 +0,0 @@
1
- require 'test_helper'
2
-
3
- class NavigationTest < ActionDispatch::IntegrationTest
4
- fixtures :all
5
-
6
- # test "the truth" do
7
- # assert true
8
- # end
9
- end
10
-
data/test/test_helper.rb DELETED
@@ -1,14 +0,0 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
- require "rails/test_help"
6
- require "shoulda/rails"
7
-
8
- Rails.backtrace_cleaner.remove_silencers!
9
-
10
- # Load support files
11
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
12
-
13
- # Run any available migration
14
- ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
@@ -1,67 +0,0 @@
1
- require 'test_helper'
2
-
3
- class EmailTest < ActiveSupport::TestCase
4
- context "An email" do
5
- setup do
6
- @email = DelayedMailhopper::Email.new
7
- end
8
-
9
- should "require a from address" do
10
- assert !@email.valid?
11
- @email.from_address = 'user@example.com'
12
- assert @email.valid?
13
- end
14
-
15
- context "generated by a mailer" do
16
- setup do
17
- @headers = {
18
- :from => 'from@example.com',
19
- :to => 'to@example.com',
20
- :cc => 'cc@example.com',
21
- :bcc => 'bcc@example.com',
22
- :reply_to => 'reply_to@example.com',
23
- :subject => 'Hiya!'
24
- }
25
- @content = 'Papaya'
26
- SampleMailer.hello(@headers, @content).deliver
27
- end
28
-
29
- should "match the intended headers and content" do
30
- email = DelayedMailhopper::Email.first
31
- assert_equal email.from_address, @headers[:from]
32
- assert_equal email.to_address, @headers[:to]
33
- assert_equal email.cc_address, @headers[:cc]
34
- assert_equal email.bcc_address, @headers[:bcc]
35
- assert_equal email.reply_to_address, @headers[:reply_to]
36
- assert_equal email.subject, @headers[:subject]
37
-
38
- # Email content will include headers as well as content
39
- assert email.content.include?(@content)
40
-
41
- assert email.sent_at.nil?
42
- end
43
-
44
- should "be queued as a delayed job" do
45
- assert_equal DelayedMailhopper::Email.count, 1
46
- assert_equal Delayed::Job.count, 1
47
- end
48
-
49
- should "be delivered via DelayedJob" do
50
- email = DelayedMailhopper::Email.first
51
- assert email.sent_at.nil?
52
-
53
- Delayed::Job.first.invoke_job
54
-
55
- email.reload
56
- assert !email.sent_at.nil?
57
- end
58
-
59
- should "be marked as sent once delivered" do
60
- email = DelayedMailhopper::Email.first
61
- assert email.sent_at.nil?
62
- email.send!
63
- assert !email.sent_at.nil?
64
- end
65
- end
66
- end
67
- end