Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Extract SomeMailer and SimpleMailer, consolidate into subdir

  • Loading branch information...
commit cc4618227ef8effac11940cb7884e42d40b3793b 1 parent 181f992
@yabawock yabawock authored
View
49 spec/lib/roadie/action_mailer_extensions_spec.rb
@@ -3,25 +3,8 @@
module Roadie
describe ActionMailerExtensions, "CSS selection" do
- mailer = Class.new(ActionMailer::Base) do
- default :css => :default
-
- # Just to make ActionMailer::Base not puke
- def self.name
- "SomeMailer"
- end
-
- def default_css
- mail(:subject => "Default CSS") do |format|
- format.html { render :text => '' }
- end
- end
-
- def override_css(css)
- mail(:subject => "Default CSS", :css => css) do |format|
- format.html { render :text => '' }
- end
- end
+ def mailer
+ SomeMailer
end
def expect_global_css(files)
@@ -57,32 +40,8 @@ def expect_global_css(files)
end
describe ActionMailerExtensions, "using HTML" do
- mailer = Class.new(ActionMailer::Base) do
- default :css => :simple
-
- # Just to make ActionMailer::Base not puke
- def self.name
- "SomeMailer"
- end
-
- def multipart
- mail(:subject => "Multipart email") do |format|
- format.html { render :text => 'Hello HTML' }
- format.text { render :text => 'Hello Text' }
- end
- end
-
- def singlepart_html
- mail(:subject => "HTML email") do |format|
- format.html { render :text => 'Hello HTML' }
- end
- end
-
- def singlepart_plain
- mail(:subject => "Text email") do |format|
- format.text { render :text => 'Hello Text' }
- end
- end
+ def mailer
+ SimpleMailer
end
let(:provider) { double("asset provider", :all => '') }
View
2  spec/spec_helper.rb
@@ -55,4 +55,4 @@ def reset_test_config
end
end
-Dir['./spec/support/**/*'].each { |file| require file }
+Dir['./spec/support/**/*.rb'].each { |file| require file }
View
0  spec/support/integration_mailer.rb → spec/support/mailers/integration_mailer.rb
File renamed without changes
View
22 spec/support/mailers/simple_mailer.rb
@@ -0,0 +1,22 @@
+class SimpleMailer < ActionMailer::Base
+ default :css => :simple
+
+ def multipart
+ mail(:subject => "Multipart email") do |format|
+ format.html { render :text => 'Hello HTML' }
+ format.text { render :text => 'Hello Text' }
+ end
+ end
+
+ def singlepart_html
+ mail(:subject => "HTML email") do |format|
+ format.html { render :text => 'Hello HTML' }
+ end
+ end
+
+ def singlepart_plain
+ mail(:subject => "Text email") do |format|
+ format.text { render :text => 'Hello Text' }
+ end
+ end
+end
View
34 spec/support/mailers/some_mailer.rb
@@ -0,0 +1,34 @@
+class SomeMailer < ActionMailer::Base
+ default :css => :default
+
+ def default_css
+ mail(:subject => "Default CSS") do |format|
+ format.html { render :text => '' }
+ end
+ end
+
+ def override_css(css)
+ mail(:subject => "Default CSS", :css => css) do |format|
+ format.html { render :text => '' }
+ end
+ end
+
+ def multipart
+ mail(:subject => "Multipart email") do |format|
+ format.html { render :text => 'Hello HTML' }
+ format.text { render :text => 'Hello Text' }
+ end
+ end
+
+ def singlepart_html
+ mail(:subject => "HTML email") do |format|
+ format.html { render :text => 'Hello HTML' }
+ end
+ end
+
+ def singlepart_plain
+ mail(:subject => "Text email") do |format|
+ format.text { render :text => 'Hello Text' }
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.