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 +1 -2
- data/VERSION +1 -1
- data/lib/actionmailer_extensions.rb +1 -1
- data/spec/action_mailer_extensions_spec.rb +8 -1
- metadata +2 -2
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
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
|
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.
|
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-
|
12
|
+
date: 2010-04-07 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|