actionmailer_extensions 0.2.0 → 0.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.
data/Rakefile CHANGED
@@ -33,8 +33,7 @@ Spec::Rake::SpecTask.new(:rcov) do |spec|
33
33
  spec.rcov = true
34
34
  end
35
35
 
36
- task :test => :check_dependencies
37
-
36
+ task :spec => :check_dependencies
38
37
  task :default => :spec
39
38
 
40
39
  begin
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.4.0
@@ -15,7 +15,7 @@ module ActionmailerExtensions
15
15
  # ensure that the mail's "to" recipients are all contained in the safe_recipients list
16
16
  send = case
17
17
  when !safe_recipients || safe_recipients.empty? then false
18
- when safe_recipients.include?(:any) then true
18
+ when (safe_recipients - [:any, 'any']).length < safe_recipients.length then true
19
19
  when (mail.to.map(&:downcase) - safe_recipients.map{|r| r.to_s.downcase}).empty? then true
20
20
  end
21
21
 
@@ -107,7 +107,14 @@ describe ActionmailerExtensions do
107
107
  @test_mailer_klass.deliver_test_email
108
108
  }.should change{ActionMailer::Base.deliveries.size}.by(1)
109
109
  end
110
-
110
+
111
+ it "should send to any address when safe recipients list contains 'any'" do
112
+ ActionMailer::Base.safe_recipients = ['any']
113
+ lambda{
114
+ @test_mailer_klass.deliver_test_email
115
+ }.should change{ActionMailer::Base.deliveries.size}.by(1)
116
+ end
117
+
111
118
  it "should restrict sending when recipient is not in the list" do
112
119
  ActionMailer::Base.safe_recipients.include?("someone@example.com").should be_false
113
120
  lambda{
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionmailer_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter MacRobert
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-21 00:00:00 +00:00
12
+ date: 2010-04-07 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency