good_mailer 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +3 -0
  3. data/Rakefile +20 -0
  4. data/app/mailers/good_mailer/mailers/mark_mailer.rb +28 -0
  5. data/app/mailers/good_mailer/mailers/user_mailer.rb +14 -0
  6. data/app/views/good_mailer/mailers/mark_mailer/mark_email.html.erb +4 -0
  7. data/app/views/good_mailer/mailers/user_mailer/welcome_email.html.erb +3 -0
  8. data/app/views/layouts/good_mailer/mailers/email.html.erb +379 -0
  9. data/config/routes.rb +2 -0
  10. data/lib/good_mailer.rb +5 -0
  11. data/lib/good_mailer/configuration.rb +11 -0
  12. data/lib/good_mailer/engine.rb +19 -0
  13. data/lib/good_mailer/version.rb +3 -0
  14. data/lib/tasks/good_mailer_tasks.rake +4 -0
  15. data/spec/dummy/README.rdoc +28 -0
  16. data/spec/dummy/Rakefile +6 -0
  17. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  18. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  19. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  20. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  21. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  22. data/spec/dummy/bin/bundle +3 -0
  23. data/spec/dummy/bin/rails +4 -0
  24. data/spec/dummy/bin/rake +4 -0
  25. data/spec/dummy/config.ru +4 -0
  26. data/spec/dummy/config/application.rb +23 -0
  27. data/spec/dummy/config/boot.rb +5 -0
  28. data/spec/dummy/config/environment.rb +5 -0
  29. data/spec/dummy/config/environments/development.rb +37 -0
  30. data/spec/dummy/config/environments/production.rb +82 -0
  31. data/spec/dummy/config/environments/test.rb +39 -0
  32. data/spec/dummy/config/initializers/assets.rb +8 -0
  33. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  34. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  35. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  36. data/spec/dummy/config/initializers/good_mailer.rb +9 -0
  37. data/spec/dummy/config/initializers/inflections.rb +16 -0
  38. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  39. data/spec/dummy/config/initializers/session_store.rb +3 -0
  40. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  41. data/spec/dummy/config/locales/en.yml +23 -0
  42. data/spec/dummy/config/routes.rb +4 -0
  43. data/spec/dummy/public/404.html +67 -0
  44. data/spec/dummy/public/422.html +67 -0
  45. data/spec/dummy/public/500.html +66 -0
  46. data/spec/dummy/public/favicon.ico +0 -0
  47. data/spec/mailers/can_send_mark_emails_spec.rb +39 -0
  48. data/spec/mailers/welcome_email_spec.rb +23 -0
  49. data/spec/spec_helper.rb +1 -0
  50. metadata +226 -0
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,4 @@
1
+ Rails.application.routes.draw do
2
+
3
+ mount GoodMailer::Engine => "/good_mailer"
4
+ end
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+
3
+ module GoodMailer
4
+ module Mailers
5
+ describe MarkMailer, :email do
6
+ before(:all) do
7
+ @email = MarkMailer.mark_email(email: 'signup@email.com',
8
+ product_name: 'My Product',
9
+ price: 1_000,
10
+ short_url: 'https://scou.tn/1234567',
11
+ scout_id: '123456789')
12
+ end
13
+
14
+ it "is delivered to the scouter's email" do
15
+ expect(@email).to deliver_to('signup@email.com')
16
+ end
17
+
18
+ it 'has the correct subject' do
19
+ expect(@email).to have_subject('Mark Found! $1,000.00 - My Product')
20
+ end
21
+
22
+ it 'contains proper product name in the mail body' do
23
+ expect(@email).to have_body_text(/An eBay item matching your scout for .*My Product/)
24
+ end
25
+
26
+ it 'contains proper price in the mail body' do
27
+ expect(@email).to have_body_text(/has just been listed for .*\$1,000\.00/)
28
+ end
29
+
30
+ it 'contains proper short url link in the mail body' do
31
+ expect(@email).to have_body_text(%r{https://scou.tn/1234567})
32
+ end
33
+
34
+ it 'contains proper scout link in the mail body' do
35
+ expect(@email).to have_body_text(%r{https://app.goodscout.io/scouts/123456789})
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ module GoodMailer
4
+ module Mailers
5
+ describe UserMailer, :email do
6
+ before(:all) do
7
+ @email = UserMailer.welcome_email(email: 'signup@email.com')
8
+ end
9
+
10
+ it "is delivered to the user's email" do
11
+ expect(@email).to deliver_to('signup@email.com')
12
+ end
13
+
14
+ it 'has the correct subject' do
15
+ expect(@email).to have_subject('Welcome to GoodScout!')
16
+ end
17
+
18
+ it 'contains proper text in the mail body' do
19
+ expect(@email).to have_body_text(/Welcome to GoodScout/)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1 @@
1
+ require 'rspectacular/spec_helpers/rails_engine'
metadata ADDED
@@ -0,0 +1,226 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: good_mailer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - jfelchner
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspectacular
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.42'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.42'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pg
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.17.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.17.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.23.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.23.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: codeclimate-test-reporter
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.3.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.3.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: email_spec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 1.6.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 1.6.0
111
+ description: Making scouts from eBay items since 2014
112
+ email: accounts+git@thekompanee.com
113
+ executables: []
114
+ extensions: []
115
+ extra_rdoc_files:
116
+ - README.md
117
+ files:
118
+ - README.md
119
+ - Rakefile
120
+ - app/mailers/good_mailer/mailers/mark_mailer.rb
121
+ - app/mailers/good_mailer/mailers/user_mailer.rb
122
+ - app/views/good_mailer/mailers/mark_mailer/mark_email.html.erb
123
+ - app/views/good_mailer/mailers/user_mailer/welcome_email.html.erb
124
+ - app/views/layouts/good_mailer/mailers/email.html.erb
125
+ - config/routes.rb
126
+ - lib/good_mailer.rb
127
+ - lib/good_mailer/configuration.rb
128
+ - lib/good_mailer/engine.rb
129
+ - lib/good_mailer/version.rb
130
+ - lib/tasks/good_mailer_tasks.rake
131
+ - spec/dummy/README.rdoc
132
+ - spec/dummy/Rakefile
133
+ - spec/dummy/app/assets/javascripts/application.js
134
+ - spec/dummy/app/assets/stylesheets/application.css
135
+ - spec/dummy/app/controllers/application_controller.rb
136
+ - spec/dummy/app/helpers/application_helper.rb
137
+ - spec/dummy/app/views/layouts/application.html.erb
138
+ - spec/dummy/bin/bundle
139
+ - spec/dummy/bin/rails
140
+ - spec/dummy/bin/rake
141
+ - spec/dummy/config.ru
142
+ - spec/dummy/config/application.rb
143
+ - spec/dummy/config/boot.rb
144
+ - spec/dummy/config/environment.rb
145
+ - spec/dummy/config/environments/development.rb
146
+ - spec/dummy/config/environments/production.rb
147
+ - spec/dummy/config/environments/test.rb
148
+ - spec/dummy/config/initializers/assets.rb
149
+ - spec/dummy/config/initializers/backtrace_silencers.rb
150
+ - spec/dummy/config/initializers/cookies_serializer.rb
151
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
152
+ - spec/dummy/config/initializers/good_mailer.rb
153
+ - spec/dummy/config/initializers/inflections.rb
154
+ - spec/dummy/config/initializers/mime_types.rb
155
+ - spec/dummy/config/initializers/session_store.rb
156
+ - spec/dummy/config/initializers/wrap_parameters.rb
157
+ - spec/dummy/config/locales/en.yml
158
+ - spec/dummy/config/routes.rb
159
+ - spec/dummy/public/404.html
160
+ - spec/dummy/public/422.html
161
+ - spec/dummy/public/500.html
162
+ - spec/dummy/public/favicon.ico
163
+ - spec/mailers/can_send_mark_emails_spec.rb
164
+ - spec/mailers/welcome_email_spec.rb
165
+ - spec/spec_helper.rb
166
+ homepage: https://github.com/goodscout/good_mailer
167
+ licenses: []
168
+ metadata: {}
169
+ post_install_message:
170
+ rdoc_options:
171
+ - "--charset = UTF-8"
172
+ require_paths:
173
+ - lib
174
+ required_ruby_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ required_rubygems_version: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ requirements: []
185
+ rubyforge_project: good_mailer
186
+ rubygems_version: 2.3.0
187
+ signing_key:
188
+ specification_version: 4
189
+ summary: Scout-Specific Functionality
190
+ test_files:
191
+ - spec/dummy/app/assets/javascripts/application.js
192
+ - spec/dummy/app/assets/stylesheets/application.css
193
+ - spec/dummy/app/controllers/application_controller.rb
194
+ - spec/dummy/app/helpers/application_helper.rb
195
+ - spec/dummy/app/views/layouts/application.html.erb
196
+ - spec/dummy/bin/bundle
197
+ - spec/dummy/bin/rails
198
+ - spec/dummy/bin/rake
199
+ - spec/dummy/config/application.rb
200
+ - spec/dummy/config/boot.rb
201
+ - spec/dummy/config/environment.rb
202
+ - spec/dummy/config/environments/development.rb
203
+ - spec/dummy/config/environments/production.rb
204
+ - spec/dummy/config/environments/test.rb
205
+ - spec/dummy/config/initializers/assets.rb
206
+ - spec/dummy/config/initializers/backtrace_silencers.rb
207
+ - spec/dummy/config/initializers/cookies_serializer.rb
208
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
209
+ - spec/dummy/config/initializers/good_mailer.rb
210
+ - spec/dummy/config/initializers/inflections.rb
211
+ - spec/dummy/config/initializers/mime_types.rb
212
+ - spec/dummy/config/initializers/session_store.rb
213
+ - spec/dummy/config/initializers/wrap_parameters.rb
214
+ - spec/dummy/config/locales/en.yml
215
+ - spec/dummy/config/routes.rb
216
+ - spec/dummy/config.ru
217
+ - spec/dummy/public/404.html
218
+ - spec/dummy/public/422.html
219
+ - spec/dummy/public/500.html
220
+ - spec/dummy/public/favicon.ico
221
+ - spec/dummy/Rakefile
222
+ - spec/dummy/README.rdoc
223
+ - spec/mailers/can_send_mark_emails_spec.rb
224
+ - spec/mailers/welcome_email_spec.rb
225
+ - spec/spec_helper.rb
226
+ has_rdoc: