email_spec 0.6.6 → 1.0.1

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.
Files changed (151) hide show
  1. data/History.txt +21 -26
  2. data/README.rdoc +5 -3
  3. data/Rakefile +16 -27
  4. data/examples/rails3_root/Gemfile +17 -0
  5. data/examples/rails3_root/Gemfile.lock +138 -0
  6. data/examples/rails3_root/README +5 -0
  7. data/examples/rails3_root/Rakefile +11 -0
  8. data/examples/rails3_root/app/controllers/application_controller.rb +3 -0
  9. data/examples/rails3_root/app/controllers/welcome_controller.rb +16 -0
  10. data/examples/rails3_root/app/helpers/application_helper.rb +2 -0
  11. data/examples/rails3_root/app/mailers/user_mailer.rb +39 -0
  12. data/examples/{rails_root → rails3_root}/app/models/user.rb +0 -0
  13. data/examples/{rails_root/app/views/user_mailer/attachments.erb → rails3_root/app/views/user_mailer/attachments.html.erb} +0 -0
  14. data/examples/{rails_root/app/views/user_mailer/newsletter.erb → rails3_root/app/views/user_mailer/newsletter.html.erb} +0 -0
  15. data/examples/{rails_root/app/views/user_mailer/signup.erb → rails3_root/app/views/user_mailer/signup.html.erb} +1 -0
  16. data/examples/rails3_root/app/views/user_mailer/signup.text.erb +4 -0
  17. data/examples/{rails_root → rails3_root}/app/views/welcome/attachments.html.erb +0 -0
  18. data/examples/{rails_root → rails3_root}/app/views/welcome/confirm.html.erb +0 -0
  19. data/examples/{rails_root → rails3_root}/app/views/welcome/index.html.erb +1 -1
  20. data/examples/{rails_root → rails3_root}/app/views/welcome/newsletter.html.erb +0 -0
  21. data/examples/{rails_root → rails3_root}/app/views/welcome/signup.html.erb +0 -0
  22. data/examples/{rails_root → rails3_root}/attachments/document.pdf +0 -0
  23. data/examples/{rails_root → rails3_root}/attachments/image.png +0 -0
  24. data/examples/rails3_root/config.ru +4 -0
  25. data/examples/rails3_root/config/application.rb +43 -0
  26. data/examples/rails3_root/config/boot.rb +14 -0
  27. data/examples/rails3_root/config/cucumber.yml +8 -0
  28. data/examples/{rails_root → rails3_root}/config/database.yml +0 -0
  29. data/examples/rails3_root/config/environment.rb +6 -0
  30. data/examples/rails3_root/config/environments/development.rb +20 -0
  31. data/examples/rails3_root/config/environments/production.rb +42 -0
  32. data/examples/rails3_root/config/environments/test.rb +30 -0
  33. data/examples/rails3_root/config/initializers/backtrace_silencers.rb +7 -0
  34. data/examples/rails3_root/config/initializers/cookie_verification_secret.rb +7 -0
  35. data/examples/rails3_root/config/initializers/delayed_job.rb +1 -0
  36. data/examples/{rails_root → rails3_root}/config/initializers/inflections.rb +0 -0
  37. data/examples/{rails_root → rails3_root}/config/initializers/mime_types.rb +0 -0
  38. data/examples/rails3_root/config/initializers/notifier_job.rb +1 -0
  39. data/examples/rails3_root/config/initializers/rspec_generator.rb +6 -0
  40. data/examples/rails3_root/config/initializers/session_store.rb +10 -0
  41. data/examples/rails3_root/config/locales/en.yml +5 -0
  42. data/examples/rails3_root/config/routes.rb +7 -0
  43. data/examples/{rails_root → rails3_root}/db/migrate/20090125013728_create_users.rb +0 -0
  44. data/examples/{rails_root → rails3_root}/db/migrate/20090908054656_create_delayed_jobs.rb +0 -0
  45. data/examples/{rails_root → rails3_root}/db/schema.rb +7 -6
  46. data/examples/rails3_root/db/seeds.rb +7 -0
  47. data/examples/rails3_root/doc/README_FOR_APP +2 -0
  48. data/examples/{rails_root → rails3_root}/features/attachments.feature +0 -0
  49. data/examples/{rails_root → rails3_root}/features/delayed_job.feature +0 -0
  50. data/examples/{rails_root → rails3_root}/features/errors.feature +0 -0
  51. data/examples/{sinatra → rails3_root}/features/example.feature +9 -0
  52. data/examples/{rails_root → rails3_root}/features/step_definitions/user_steps.rb +2 -2
  53. data/examples/rails3_root/features/step_definitions/web_steps.rb +219 -0
  54. data/examples/{rails_root → rails3_root}/features/support/env.rb +10 -10
  55. data/examples/rails3_root/features/support/env_ext.rb +2 -0
  56. data/examples/{rails_root → rails3_root}/features/support/paths.rb +2 -2
  57. data/examples/rails3_root/lib/notifier_job.rb +5 -0
  58. data/examples/{rails_root → rails3_root}/lib/tasks/cucumber.rake +6 -0
  59. data/examples/rails3_root/lib/tasks/rspec.rake +69 -0
  60. data/examples/rails3_root/public/404.html +26 -0
  61. data/examples/rails3_root/public/422.html +26 -0
  62. data/examples/rails3_root/public/500.html +26 -0
  63. data/examples/{rails_root → rails3_root}/public/favicon.ico +0 -0
  64. data/examples/{rails_root → rails3_root}/public/images/rails.png +0 -0
  65. data/examples/{rails_root → rails3_root}/public/javascripts/application.js +0 -0
  66. data/examples/{rails_root → rails3_root}/public/javascripts/controls.js +5 -3
  67. data/examples/{rails_root → rails3_root}/public/javascripts/dragdrop.js +7 -6
  68. data/examples/{rails_root → rails3_root}/public/javascripts/effects.js +8 -13
  69. data/examples/{rails_root → rails3_root}/public/javascripts/prototype.js +1573 -1019
  70. data/examples/rails3_root/public/javascripts/rails.js +109 -0
  71. data/examples/{rails_root → rails3_root}/public/robots.txt +0 -0
  72. data/examples/{rails_root → rails3_root}/script/cucumber +0 -0
  73. data/examples/rails3_root/script/rails +9 -0
  74. data/examples/rails3_root/spec/controllers/welcome_controller_spec.rb +20 -0
  75. data/examples/{rails_root → rails3_root}/spec/models/user_mailer_spec.rb +7 -18
  76. data/examples/rails3_root/spec/spec_helper.rb +19 -0
  77. data/examples/sinatra_root/config.ru +4 -0
  78. data/examples/{sinatra → sinatra_root}/features/errors.feature +0 -0
  79. data/examples/{rails_root → sinatra_root}/features/example.feature +0 -0
  80. data/examples/{sinatra → sinatra_root}/features/step_definitions/user_steps.rb +2 -2
  81. data/examples/sinatra_root/features/step_definitions/web_steps.rb +219 -0
  82. data/examples/sinatra_root/features/support/env.rb +21 -0
  83. data/examples/{sinatra → sinatra_root}/features/support/paths.rb +9 -4
  84. data/examples/sinatra_root/lib/example_sinatra_app.rb +35 -0
  85. data/lib/email_spec.rb +2 -2
  86. data/lib/email_spec/deliveries.rb +7 -11
  87. data/lib/email_spec/email_viewer.rb +1 -1
  88. data/lib/email_spec/helpers.rb +7 -7
  89. data/lib/email_spec/mail_ext.rb +11 -0
  90. data/lib/email_spec/matchers.rb +31 -26
  91. data/lib/generators/email_spec/steps/USAGE +5 -0
  92. data/lib/generators/email_spec/steps/steps_generator.rb +14 -0
  93. data/{examples/rails3_root/features/step_definitions → lib/generators/email_spec/steps/templates}/email_steps.rb +0 -0
  94. data/spec/email_spec/helpers_spec.rb +4 -6
  95. data/spec/email_spec/mail_ext_spec.rb +34 -0
  96. data/spec/email_spec/matchers_spec.rb +227 -37
  97. data/spec/spec_helper.rb +14 -2
  98. metadata +174 -207
  99. data/examples/rails_root/Rakefile +0 -13
  100. data/examples/rails_root/app/controllers/application_controller.rb +0 -15
  101. data/examples/rails_root/app/controllers/welcome_controller.rb +0 -16
  102. data/examples/rails_root/app/helpers/application_helper.rb +0 -3
  103. data/examples/rails_root/app/helpers/welcome_helper.rb +0 -2
  104. data/examples/rails_root/app/models/user_mailer.rb +0 -39
  105. data/examples/rails_root/config/boot.rb +0 -110
  106. data/examples/rails_root/config/cucumber.yml +0 -7
  107. data/examples/rails_root/config/environment.rb +0 -28
  108. data/examples/rails_root/config/environments/cucumber.rb +0 -29
  109. data/examples/rails_root/config/environments/development.rb +0 -17
  110. data/examples/rails_root/config/environments/production.rb +0 -28
  111. data/examples/rails_root/config/environments/test.rb +0 -28
  112. data/examples/rails_root/config/initializers/new_rails_defaults.rb +0 -17
  113. data/examples/rails_root/config/routes.rb +0 -45
  114. data/examples/rails_root/doc/README_FOR_APP +0 -5
  115. data/examples/rails_root/features/step_definitions/web_steps.rb +0 -273
  116. data/examples/rails_root/features/support/env_ext.rb +0 -6
  117. data/examples/rails_root/public/404.html +0 -30
  118. data/examples/rails_root/public/422.html +0 -30
  119. data/examples/rails_root/public/500.html +0 -33
  120. data/examples/rails_root/public/dispatch.rb +0 -10
  121. data/examples/rails_root/script/about +0 -4
  122. data/examples/rails_root/script/autospec +0 -5
  123. data/examples/rails_root/script/console +0 -3
  124. data/examples/rails_root/script/dbconsole +0 -3
  125. data/examples/rails_root/script/delayed_job +0 -5
  126. data/examples/rails_root/script/destroy +0 -3
  127. data/examples/rails_root/script/generate +0 -3
  128. data/examples/rails_root/script/performance/benchmarker +0 -3
  129. data/examples/rails_root/script/performance/profiler +0 -3
  130. data/examples/rails_root/script/performance/request +0 -3
  131. data/examples/rails_root/script/plugin +0 -3
  132. data/examples/rails_root/script/process/inspector +0 -3
  133. data/examples/rails_root/script/process/reaper +0 -3
  134. data/examples/rails_root/script/process/spawner +0 -3
  135. data/examples/rails_root/script/runner +0 -3
  136. data/examples/rails_root/script/server +0 -3
  137. data/examples/rails_root/script/spec +0 -5
  138. data/examples/rails_root/script/spec_server +0 -125
  139. data/examples/rails_root/spec/controllers/welcome_controller_spec.rb +0 -15
  140. data/examples/rails_root/spec/model_factory.rb +0 -6
  141. data/examples/rails_root/spec/models/user_spec.rb +0 -5
  142. data/examples/rails_root/spec/rcov.opts +0 -2
  143. data/examples/rails_root/spec/spec.opts +0 -4
  144. data/examples/rails_root/spec/spec_helper.rb +0 -51
  145. data/examples/sinatra/app.rb +0 -33
  146. data/examples/sinatra/features/step_definitions/email_steps.rb +0 -182
  147. data/examples/sinatra/features/step_definitions/web_steps.rb +0 -273
  148. data/examples/sinatra/features/support/env.rb +0 -39
  149. data/examples/sinatra_root/features/step_definitions/email_steps.rb +0 -194
  150. data/lib/email_spec/#helpers.rb# +0 -168
  151. data/spec/spec.opts +0 -4
@@ -1,23 +1,18 @@
1
+ == 1.x (git)
1
2
 
2
- This is the Rails 2 compatible branch/gem.
3
+ == 1.0 2010-07-31 Rails 3.0 Release
4
+ This release makes email-spec compatible with Rails 3 and RSpec 2.x.
3
5
 
4
- == 0.6.x (git)
6
+ IMPORTANT: As of 1.0 email-spec is no longer backwards compatible wit Rails 2.x. I will be maintaining a 0.6
7
+ branch on github/rubygems for Rails 2 compatibility if anyone wants new features backported.
5
8
 
6
- == 0.6.6
7
- * Backports "Support cache method in reset_mailer" (Rob Olson)
8
-
9
- == 0.6.5
10
- * Fixes gemspec by adding RSpec as a dependency. (Ben Hutchison)
11
-
12
- == 0.6.4
13
-
14
- === Bugfixes
15
- * Updates the matchers to use RSpec's new API instead of deprecated simple_matcher. (Aaron Gibralter)
16
-
17
- == 0.6.3
9
+ This was truly a community effort and I appreciate all of time and effort donated by those involved. Specifically:
10
+ * Maxim Chernyak for the initial conversion work to Rails 3
11
+ * Tim Harper for ironing out various matcher bugs
12
+ * Patrick Muldoon for doing a fantastic job of cleaning up the features and specs. He also fixed the
13
+ DelayedJob support and worked through all the bundler issues the project was facing.
18
14
 
19
15
  === Bugfixes
20
- * Checks to prevent deprecation warnings on DelayedJob. (Patrick Muldoon)
21
16
  * Further checks for older DelayedJob versions to fix compatibility issues. (Andrea Longhi and others)
22
17
 
23
18
  == 0.6.2 2010-03-21
@@ -44,7 +39,7 @@ This is the Rails 2 compatible branch/gem.
44
39
  === Changes
45
40
  * Deprecated steps were removed. (Kieran Pilkington)
46
41
 
47
- === Bugfixes
42
+ === Bufixes
48
43
 
49
44
  == 0.5.0 2010-02-22
50
45
 
@@ -57,10 +52,10 @@ This is the Rails 2 compatible branch/gem.
57
52
  * "save and open all html emails"
58
53
  * "save and open all raw emails"
59
54
 
60
- === Bugfixes
55
+ === Bufixes
61
56
  * Gracefully handle cases where emails do not have a 'to' value. (Kieran Pilkington)
62
57
 
63
- === Bugfixes
58
+ === Bufixes
64
59
 
65
60
  == 0.4.0 2010-01-07
66
61
 
@@ -68,12 +63,12 @@ This is the Rails 2 compatible branch/gem.
68
63
  * Added support for action_mailer_cache_delivery plugin. (Dan Dofter)
69
64
  You must use the fork at: http://github.com/liangzan/action_mailer_cache_delivery
70
65
 
71
- === Bugfixes
66
+ === Bufixes
72
67
  * be_delivered_from matcher now compares both sender name and email address. (Dan Dofter)
73
68
 
74
69
  == 0.3.8 2009-12-23
75
70
 
76
- === Bugfixes
71
+ === Bufixes
77
72
  * Guard against cc and bcc fields being nil for ActionMailer. (Piotr Sarnacki)
78
73
 
79
74
  == 0.3.7 2009-12-17
@@ -133,7 +128,7 @@ Big shoutout to Kieran Pilkington who did the majority of work for this release.
133
128
  * Then /^I should not receive any emails?$/
134
129
  * When %r{^"([^"]*?)" opens? the email$} do |address|
135
130
 
136
- === Bugfixes
131
+ === Bufixes
137
132
 
138
133
  == 0.2.1 2009-5-29
139
134
 
@@ -149,19 +144,19 @@ No changes. Bumping version for RubyForge release.
149
144
 
150
145
  == 0.1.4 2009-5-29
151
146
 
152
- === Bugfixes
147
+ === Bufixes
153
148
  * Require deliveries in the helpers so it doesn't blow up with RSpec. (Craig Webster)
154
149
 
155
150
  == 0.1.3 2009-4-15
156
151
 
157
- === Bugfixes
152
+ === Bufixes
158
153
  * Fixed regular expressions in genertaed steps. (Ben Mabey)
159
154
  * World semantics changed in cucumber (0.2.3.2), email_spec now uses the new API. (Hector Morales)
160
155
 
161
156
  == 0.1.2 2009-4-05
162
157
 
163
158
  === New features
164
- === Bugfixes
159
+ === Bufixes
165
160
  * Actually added the renamed generators to the gem so people could use it! D'oh! (Ben Mabey)
166
161
  * You can either use "./script generate email_spec" or "rubigen rails email_spec"
167
162
  * Removed Rake tasks from example application to prevent conflicts when used as a plugin. (Ben Mabey)
@@ -170,7 +165,7 @@ No changes. Bumping version for RubyForge release.
170
165
  === New features
171
166
  * Switched dir structure over to support rubigen. (Dr. Nic)
172
167
 
173
- === Bugfixes
168
+ === Bufixes
174
169
 
175
170
  == 0.1.0 2009-3-25
176
171
  === New features
@@ -192,7 +187,7 @@ No changes. Bumping version for RubyForge release.
192
187
  end
193
188
  end
194
189
 
195
- === Bugfixes
190
+ === Bufixes
196
191
  * Revert parse_email_for_link helper method to allow for text links as well as explicit link finding. (Mischa Fierer)
197
192
  * Isolated variances between using email-spec with an ARMailer project. (Luke Melia)
198
193
 
@@ -22,8 +22,10 @@ you generally don't want to include those projects unless you need them in produ
22
22
 
23
23
  gem install email_spec
24
24
 
25
- # config/environments/test.rb
26
- config.gem 'email_spec', :lib => 'email_spec'
25
+ # Gemfile
26
+ group :test do
27
+ gem 'email_spec'
28
+ end
27
29
 
28
30
  === Cucumber
29
31
 
@@ -37,7 +39,7 @@ It will also add a Before hook for Cucumber so that emails are cleared at the st
37
39
 
38
40
  Then:
39
41
 
40
- script/generate email_spec
42
+ rails generate email_spec:steps
41
43
 
42
44
  This will give you a bunch of steps to get started with in step_definitions/email_steps.rb
43
45
 
data/Rakefile CHANGED
@@ -1,5 +1,7 @@
1
1
  require 'rubygems'
2
- require 'spec/rake/spectask'
2
+ require 'bundler/setup'
3
+
4
+ require 'rspec/core/rake_task'
3
5
 
4
6
 
5
7
  begin
@@ -20,22 +22,10 @@ begin
20
22
  s.has_rdoc = true
21
23
  s.extra_rdoc_files = %w(README.rdoc MIT-LICENSE.txt)
22
24
  s.rubyforge_project = 'email-spec'
23
- s.add_dependency 'rspec'
25
+ s.add_runtime_dependency 'rspec', '~> 2.0.0'
24
26
  end
25
27
  rescue LoadError
26
- puts "Jeweler not available. Install it with: sudo gem install jeweler"
27
- end
28
-
29
- # TODO: switch to gem bundler
30
- ([['delayed_job', '2.0.3']] + %w[mimetype-fu fixjour pony sinatra rack-test].map{|g| [g]}).each do |gem_args|
31
- gem_name = gem_args.first
32
- gem_version = gem_args.size > 1 ? gem_args[1] : nil
33
- begin
34
- gem(*[gem_args].flatten)
35
- rescue Gem::LoadError
36
- puts "Installing #{gem_name} for the example rails app..."
37
- puts `gem install #{gem_name} #{gem_version ? ('--version='+gem_version) : ''} --no-rdoc --no-ri`
38
- end
28
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
39
29
  end
40
30
 
41
31
  begin
@@ -47,17 +37,13 @@ rescue LoadError
47
37
  end
48
38
  end
49
39
 
50
- require 'spec/rake/spectask'
51
- Spec::Rake::SpecTask.new(:spec) do |spec|
52
- spec.libs << 'lib' << 'spec'
53
- spec.spec_files = FileList['spec/**/*_spec.rb']
54
- end
40
+ require 'rspec/core/rake_task'
41
+ RSpec::Core::RakeTask.new
55
42
 
56
43
  namespace :example_app do
57
- Spec::Rake::SpecTask.new(:spec) do |spec|
44
+ RSpec::Core::RakeTask.new do |spec|
58
45
  desc "Specs for Example app"
59
- spec.libs << 'lib' << 'spec'
60
- spec.spec_files = FileList['examples/rails_root/spec/**/*_spec.rb']
46
+ spec.pattern = './examples/rails3_root/spec/**/*_spec.rb'
61
47
  end
62
48
  end
63
49
 
@@ -65,9 +51,13 @@ task :default => [:features, :spec, 'example_app:spec']
65
51
 
66
52
  desc "Cleans the project of any tmp file that should not be included in the gemspec."
67
53
  task :clean do
68
- FileUtils.rm_f('examples/rails_root/features/step_definitions/email_steps.rb')
69
- FileUtils.rm_rf('examples/rails_root/log')
70
- FileUtils.rm_rf('examples/rails_root/vendor')
54
+ #remove stuff from example rails apps
55
+ %w[ rails3 sinatra ].each do |ver|
56
+ FileUtils.rm_f("examples/#{ver}_root/features/step_definitions/email_steps.rb")
57
+ FileUtils.rm_rf("examples/#{ver}_root/log")
58
+ FileUtils.rm_rf("examples/#{ver}_root/vendor")
59
+ end
60
+
71
61
  %w[*.sqlite3 *.log].each do |pattern|
72
62
  `find . -name "#{pattern}" -delete`
73
63
  end
@@ -75,4 +65,3 @@ end
75
65
 
76
66
  desc "Cleans the dir and builds the gem"
77
67
  task :prep => [:clean, :gemspec, :build]
78
-
@@ -0,0 +1,17 @@
1
+ source 'http://gemcutter.org'
2
+
3
+ gem 'rails', '3.0.0.rc'
4
+ gem 'sqlite3-ruby', :require => 'sqlite3'
5
+
6
+ gem 'delayed_job', '>=2.0.3'
7
+ gem 'mimetype-fu', :require => 'mimetype_fu'
8
+
9
+ group :test do
10
+ gem "test-unit"
11
+ gem "cucumber-rails"
12
+ gem "database_cleaner"
13
+ gem 'capybara'
14
+ gem "rspec", ">= 2.0.0.beta.19"
15
+ gem "rspec-rails", ">= 2.0.0.beta.19"
16
+ gem "email_spec", :path => "../../"
17
+ end
@@ -0,0 +1,138 @@
1
+ PATH
2
+ remote: /Users/bmabey/Programming/ruby/email-spec
3
+ specs:
4
+ email_spec (0.6.2)
5
+
6
+ GEM
7
+ remote: http://gemcutter.org/
8
+ specs:
9
+ abstract (1.0.0)
10
+ actionmailer (3.0.0.rc)
11
+ actionpack (= 3.0.0.rc)
12
+ mail (~> 2.2.5)
13
+ actionpack (3.0.0.rc)
14
+ activemodel (= 3.0.0.rc)
15
+ activesupport (= 3.0.0.rc)
16
+ builder (~> 2.1.2)
17
+ erubis (~> 2.6.6)
18
+ i18n (~> 0.4.1)
19
+ rack (~> 1.2.1)
20
+ rack-mount (~> 0.6.9)
21
+ rack-test (~> 0.5.4)
22
+ tzinfo (~> 0.3.22)
23
+ activemodel (3.0.0.rc)
24
+ activesupport (= 3.0.0.rc)
25
+ builder (~> 2.1.2)
26
+ i18n (~> 0.4.1)
27
+ activerecord (3.0.0.rc)
28
+ activemodel (= 3.0.0.rc)
29
+ activesupport (= 3.0.0.rc)
30
+ arel (~> 0.4.0)
31
+ tzinfo (~> 0.3.22)
32
+ activeresource (3.0.0.rc)
33
+ activemodel (= 3.0.0.rc)
34
+ activesupport (= 3.0.0.rc)
35
+ activesupport (3.0.0.rc)
36
+ arel (0.4.0)
37
+ activesupport (>= 3.0.0.beta)
38
+ builder (2.1.2)
39
+ capybara (0.3.9)
40
+ culerity (>= 0.2.4)
41
+ mime-types (>= 1.16)
42
+ nokogiri (>= 1.3.3)
43
+ rack (>= 1.0.0)
44
+ rack-test (>= 0.5.4)
45
+ selenium-webdriver (>= 0.0.3)
46
+ cucumber (0.8.5)
47
+ builder (~> 2.1.2)
48
+ diff-lcs (~> 1.1.2)
49
+ gherkin (~> 2.1.4)
50
+ json_pure (~> 1.4.3)
51
+ term-ansicolor (~> 1.0.4)
52
+ cucumber-rails (0.3.2)
53
+ cucumber (>= 0.8.0)
54
+ culerity (0.2.10)
55
+ daemons (1.1.0)
56
+ database_cleaner (0.5.2)
57
+ delayed_job (2.0.3)
58
+ daemons
59
+ diff-lcs (1.1.2)
60
+ erubis (2.6.6)
61
+ abstract (>= 1.0.0)
62
+ ffi (0.6.3)
63
+ rake (>= 0.8.7)
64
+ gherkin (2.1.5)
65
+ trollop (~> 1.16.2)
66
+ i18n (0.4.1)
67
+ json_pure (1.4.3)
68
+ mail (2.2.5)
69
+ activesupport (>= 2.3.6)
70
+ mime-types
71
+ treetop (>= 1.4.5)
72
+ mime-types (1.16)
73
+ mimetype-fu (0.1.2)
74
+ nokogiri (1.4.2)
75
+ polyglot (0.3.1)
76
+ rack (1.2.1)
77
+ rack-mount (0.6.9)
78
+ rack (>= 1.0.0)
79
+ rack-test (0.5.4)
80
+ rack (>= 1.0)
81
+ rails (3.0.0.rc)
82
+ actionmailer (= 3.0.0.rc)
83
+ actionpack (= 3.0.0.rc)
84
+ activerecord (= 3.0.0.rc)
85
+ activeresource (= 3.0.0.rc)
86
+ activesupport (= 3.0.0.rc)
87
+ bundler (>= 1.0.0.rc.1)
88
+ railties (= 3.0.0.rc)
89
+ railties (3.0.0.rc)
90
+ actionpack (= 3.0.0.rc)
91
+ activesupport (= 3.0.0.rc)
92
+ rake (>= 0.8.3)
93
+ thor (~> 0.14.0)
94
+ rake (0.8.7)
95
+ rspec (2.0.0.beta.19)
96
+ rspec-core (= 2.0.0.beta.19)
97
+ rspec-expectations (= 2.0.0.beta.19)
98
+ rspec-mocks (= 2.0.0.beta.19)
99
+ rspec-core (2.0.0.beta.19)
100
+ rspec-expectations (2.0.0.beta.19)
101
+ diff-lcs (>= 1.1.2)
102
+ rspec-mocks (2.0.0.beta.19)
103
+ rspec-rails (2.0.0.beta.19)
104
+ rspec (= 2.0.0.beta.19)
105
+ webrat (>= 0.7.2.beta.1)
106
+ rubyzip (0.9.4)
107
+ selenium-webdriver (0.0.27)
108
+ ffi (>= 0.6.1)
109
+ json_pure
110
+ rubyzip
111
+ sqlite3-ruby (1.3.1)
112
+ term-ansicolor (1.0.5)
113
+ test-unit (2.1.0)
114
+ thor (0.14.0)
115
+ treetop (1.4.8)
116
+ polyglot (>= 0.3.1)
117
+ trollop (1.16.2)
118
+ tzinfo (0.3.22)
119
+ webrat (0.7.2.beta.1)
120
+ nokogiri (>= 1.2.0)
121
+ rack (>= 1.0)
122
+ rack-test (>= 0.5.3)
123
+
124
+ PLATFORMS
125
+ ruby
126
+
127
+ DEPENDENCIES
128
+ capybara
129
+ cucumber-rails
130
+ database_cleaner
131
+ delayed_job (>= 2.0.3)
132
+ email_spec!
133
+ mimetype-fu
134
+ rails (= 3.0.0.rc)
135
+ rspec (>= 2.0.0.beta.19)
136
+ rspec-rails (>= 2.0.0.beta.19)
137
+ sqlite3-ruby
138
+ test-unit
@@ -0,0 +1,5 @@
1
+ == Running features in this app
2
+
3
+ 1. Make sure you have latest bundler gem.
4
+ 2. cd into rails3_root and run `bundle install`
5
+ 3. run script/rails generate email_spec:steps
@@ -0,0 +1,11 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ require 'rake'
7
+ require 'rake/testtask'
8
+ require 'rake/rdoctask'
9
+ require 'delayed/tasks'
10
+
11
+ Rails3Root::Application.load_tasks
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,16 @@
1
+ class WelcomeController < ApplicationController
2
+ def signup
3
+ UserMailer.signup(params['Email'], params['Name']).deliver
4
+ end
5
+
6
+ def confirm
7
+ end
8
+
9
+ def newsletter
10
+ Delayed::Job.enqueue(NotifierJob.new(:newsletter,params['Email'], params['Name']))
11
+ end
12
+
13
+ def attachments
14
+ UserMailer.attachments_mail(params['Email'], params['Name']).deliver
15
+ end
16
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,39 @@
1
+ class UserMailer < ActionMailer::Base
2
+ default :from => "admin@example.com",
3
+ :sent_on => Time.now.to_s
4
+
5
+
6
+ def signup(email, name)
7
+ @name = name
8
+
9
+ mail :to => email,
10
+ :subject => "Account confirmation"
11
+ end
12
+
13
+ def newsletter(email, name)
14
+ @name = name
15
+
16
+ mail :to => email,
17
+ :subject => "Newsletter sent"
18
+ end
19
+
20
+ def attachments_mail(email, name)
21
+ @name = name
22
+
23
+ add_attachment 'image.png'
24
+ add_attachment 'document.pdf'
25
+
26
+ mail :to => email,
27
+ :subject => "Attachments test"
28
+ end
29
+
30
+ private
31
+
32
+ def add_attachment(attachment_name)
33
+ attachment_path = "#{Rails.root}/attachments/#{attachment_name}"
34
+ File.open(attachment_path) do |file|
35
+ filename = File.basename(file.path)
36
+ attachments[filename] = {:content_type => File.mime_type?(file), :content => file.read}
37
+ end
38
+ end
39
+ end