postageapp 1.3.1 → 1.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.
- checksums.yaml +5 -5
- data/.gitignore +6 -0
- data/.travis.yml +9 -40
- data/LICENSE.md +1 -1
- data/README.md +117 -13
- data/Rakefile +15 -4
- data/VERSION +1 -0
- data/app/ingresses/action_mailbox/ingresses/postage_app.rb +2 -0
- data/app/ingresses/action_mailbox/ingresses/postage_app/inbound_emails_controller.rb +50 -0
- data/config/routes.rb +6 -0
- data/exe/postageapp +37 -0
- data/lib/generators/postageapp/postageapp_generator.rb +9 -6
- data/lib/postageapp.rb +53 -35
- data/lib/postageapp/cli.rb +14 -0
- data/lib/postageapp/cli/command.rb +110 -0
- data/lib/postageapp/cli/command/config.rb +74 -0
- data/lib/postageapp/cli/command/create_mailbox.rb +21 -0
- data/lib/postageapp/cli/command/env.rb +58 -0
- data/lib/postageapp/cli/command/get_project_info.rb +3 -0
- data/lib/postageapp/configuration.rb +237 -74
- data/lib/postageapp/engine.rb +9 -0
- data/lib/postageapp/env.rb +9 -0
- data/lib/postageapp/mailer.rb +1 -11
- data/lib/postageapp/mailer/mailer_4.rb +30 -14
- data/lib/postageapp/rails/railtie.rb +1 -3
- data/lib/postageapp/request.rb +6 -1
- data/log/.gitignore +1 -0
- data/postageapp.gemspec +8 -10
- data/script/with +2 -2
- data/test/gemfiles/Gemfile.rails-2.3.x +1 -1
- data/test/gemfiles/Gemfile.rails-3.0.x +1 -1
- data/test/gemfiles/Gemfile.rails-3.1.x +1 -1
- data/test/gemfiles/Gemfile.rails-3.2.x +1 -1
- data/test/gemfiles/Gemfile.rails-4.0.x +1 -1
- data/test/gemfiles/Gemfile.rails-4.1.x +1 -1
- data/test/gemfiles/Gemfile.rails-4.2.x +1 -2
- data/test/gemfiles/Gemfile.rails-5.0.x +2 -3
- data/test/gemfiles/Gemfile.rails-5.2.x +12 -0
- data/test/gemfiles/Gemfile.rails-6.0.x +12 -0
- data/test/gemfiles/Gemfile.rails-6.1.x +12 -0
- data/test/gemfiles/Gemfile.ruby +2 -3
- data/test/helper.rb +3 -3
- data/test/log/.gitignore +1 -0
- data/test/mailer/action_mailer_3/notifier.rb +1 -1
- data/test/tmp/.gitignore +1 -0
- data/test/travis_test.rb +58 -40
- data/test/{configuration_test.rb → unit/configuration_test.rb} +5 -3
- data/test/{failed_request_test.rb → unit/failed_request_test.rb} +6 -6
- data/test/{live_test.rb → unit/live_test.rb} +1 -36
- data/test/{mail_delivery_method_test.rb → unit/mail_delivery_method_test.rb} +1 -1
- data/test/{mailer_4_test.rb → unit/mailer_4_test.rb} +2 -2
- data/test/{mailer_helper_methods_test.rb → unit/mailer_helper_methods_test.rb} +4 -4
- data/test/{postageapp_test.rb → unit/postageapp_test.rb} +7 -1
- data/test/{rails_initialization_test.rb → unit/rails_initialization_test.rb} +2 -2
- data/test/{request_test.rb → unit/request_test.rb} +15 -15
- data/test/{response_test.rb → unit/response_test.rb} +4 -4
- data/test/unit/tmp/.gitignore +1 -0
- data/tmp/.gitignore +1 -0
- metadata +40 -46
- data/lib/postageapp/mailer/mailer_2.rb +0 -140
- data/lib/postageapp/mailer/mailer_3.rb +0 -190
- data/lib/postageapp/version.rb +0 -3
- data/test/mailer/action_mailer_2/notifier.rb +0 -77
- data/test/mailer/action_mailer_2/notifier/with_body_and_attachment.erb +0 -1
- data/test/mailer/action_mailer_2/notifier/with_custom_postage_variables.text.html.erb +0 -1
- data/test/mailer/action_mailer_2/notifier/with_custom_postage_variables.text.plain.erb +0 -1
- data/test/mailer/action_mailer_2/notifier/with_html_and_text_views.text.html.erb +0 -1
- data/test/mailer/action_mailer_2/notifier/with_html_and_text_views.text.plain.erb +0 -1
- data/test/mailer/action_mailer_2/notifier/with_simple_view.erb +0 -1
- data/test/mailer/action_mailer_2/notifier/with_text_only_view.text.plain.erb +0 -1
- data/test/mailer_2_test.rb +0 -95
- data/test/mailer_3_test.rb +0 -118
data/test/mailer_3_test.rb
DELETED
@@ -1,118 +0,0 @@
|
|
1
|
-
require_relative './helper'
|
2
|
-
|
3
|
-
class Mailer3Test < MiniTest::Test
|
4
|
-
require_action_mailer(3) do
|
5
|
-
require File.expand_path('mailer/action_mailer_3/notifier', File.dirname(__FILE__))
|
6
|
-
|
7
|
-
puts "\e[0m\e[32mRunning #{File.basename(__FILE__)} for action_mailer #{ActionMailer::VERSION::STRING}\e[0m"
|
8
|
-
|
9
|
-
def test_create_with_no_content
|
10
|
-
mail = Notifier.with_no_content
|
11
|
-
|
12
|
-
assert_equal({ }, mail.arguments['content'])
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_create_with_no_subject
|
16
|
-
mail = Notifier.with_no_subject
|
17
|
-
|
18
|
-
assert mail.arguments['headers'][:subject].nil?
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_create_with_simple_view
|
22
|
-
mail = Notifier.with_simple_view
|
23
|
-
|
24
|
-
assert_equal 'with layout simple view content', mail.arguments['content']['text/html']
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_create_with_text_only_view
|
28
|
-
mail = Notifier.with_text_only_view
|
29
|
-
|
30
|
-
assert_equal 'text content', mail.arguments['content']['text/plain']
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_create_with_html_and_text_views
|
34
|
-
mail = Notifier.with_html_and_text_views
|
35
|
-
|
36
|
-
assert_equal 'text content', mail.arguments['content']['text/plain']
|
37
|
-
assert_equal 'with layout html content', mail.arguments['content']['text/html']
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_deliver_with_html_and_text_views
|
41
|
-
mock_successful_send
|
42
|
-
|
43
|
-
assert response = Notifier.with_html_and_text_views.deliver
|
44
|
-
assert response.is_a?(PostageApp::Response)
|
45
|
-
assert response.ok?
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_create_with_body_and_attachment_as_file
|
49
|
-
mail = Notifier.with_body_and_attachment_as_file
|
50
|
-
|
51
|
-
assert_equal 'manual body text', mail.arguments['content']['text/html']
|
52
|
-
assert_equal 'text/plain', mail.arguments['attachments']['sample_file.txt']['content_type']
|
53
|
-
assert_equal "RmlsZSBjb250ZW50\n", mail.arguments['attachments']['sample_file.txt']['content']
|
54
|
-
end
|
55
|
-
|
56
|
-
def test_create_with_body_and_attachment_as_hash
|
57
|
-
mail = Notifier.with_body_and_attachment_as_hash
|
58
|
-
|
59
|
-
assert_equal 'manual body text', mail.arguments['content']['text/html']
|
60
|
-
assert_equal 'text/rich', mail.arguments['attachments']['sample_file.txt']['content_type']
|
61
|
-
assert_equal "RmlsZSBjb250ZW50\n", mail.arguments['attachments']['sample_file.txt']['content']
|
62
|
-
end
|
63
|
-
|
64
|
-
def test_create_with_custom_postage_variables
|
65
|
-
mail = Notifier.with_custom_postage_variables
|
66
|
-
|
67
|
-
args = mail.arguments_to_send
|
68
|
-
|
69
|
-
assert_equal 'custom_uid', args['uid']
|
70
|
-
assert_equal 'custom_api_key', args['api_key']
|
71
|
-
|
72
|
-
args = args['arguments']
|
73
|
-
|
74
|
-
assert_equal(
|
75
|
-
{
|
76
|
-
'test1@example.net' => { 'name' => 'Test 1' },
|
77
|
-
'test2@example.net' => { 'name' => 'Test 2' }
|
78
|
-
},
|
79
|
-
args['recipients']
|
80
|
-
)
|
81
|
-
|
82
|
-
assert_equal 'test-template', args['template']
|
83
|
-
assert_equal({ 'variable' => 'value' }, args['variables'])
|
84
|
-
assert_equal 'CustomValue1', args['headers']['CustomHeader1']
|
85
|
-
assert_equal 'CustomValue2', args['headers']['CustomHeader2']
|
86
|
-
assert_equal 'text content', args['content']['text/plain']
|
87
|
-
assert_equal 'with layout html content', args['content']['text/html']
|
88
|
-
end
|
89
|
-
|
90
|
-
def test_create_with_recipient_override
|
91
|
-
PostageApp.configuration.recipient_override = 'override@example.net'
|
92
|
-
|
93
|
-
assert mail = Notifier.with_html_and_text_views
|
94
|
-
|
95
|
-
assert_equal 'recipient@example.net', mail.arguments['recipients']
|
96
|
-
assert_equal 'override@example.net', mail.arguments_to_send['arguments']['recipient_override']
|
97
|
-
end
|
98
|
-
|
99
|
-
def test_deliver_for_test_mailer
|
100
|
-
mail = Notifier.with_simple_view
|
101
|
-
|
102
|
-
mail.delivery_method(Mail::TestMailer)
|
103
|
-
mail.deliver
|
104
|
-
|
105
|
-
assert_equal [ mail ], ActionMailer::Base.deliveries
|
106
|
-
end
|
107
|
-
|
108
|
-
def test_deliver_for_not_performing_deliveries_with_test_mailer
|
109
|
-
mail = Notifier.with_simple_view
|
110
|
-
|
111
|
-
mail.perform_deliveries = false
|
112
|
-
mail.delivery_method(Mail::TestMailer)
|
113
|
-
mail.deliver
|
114
|
-
|
115
|
-
assert_equal [ ], ActionMailer::Base.deliveries
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|