sendwithus_ruby_action_mailer 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5879830a27f65ef23f8300bff7374421cfbab02
4
- data.tar.gz: 7ddaef1e91acd8d76a669b5561931670466f7ed5
3
+ metadata.gz: 35c5adf9a2bbeb0c1fc6854cefc705b06f80057f
4
+ data.tar.gz: 02fbf0496ca2e4da5f69bb08b89ead84d6c607c3
5
5
  SHA512:
6
- metadata.gz: 6d3726ded66f4004240505a5d436d8370386540be5c515458a6d2354db5ea59807f4d223f627de4b00fb79809fc19f1bf1bd4794e2f3f340ac8d7bd962c64336
7
- data.tar.gz: 9f7d7ab7e2d5601230a1c32e8ab7b55e7cb70ea3cdf8ff3e5c2406366f448b3bfff1b0cf1f1e745ddb4aeeec8e90e9d428b9f51b23a509e1341db31a06dbc981
6
+ metadata.gz: 734e76a3e462c8187e7365164b74f0ce4cc544fe98928df79fe458de45e4aeae9397db19dfcec1cef5965d4f31933eaf6251af510789ea28f405dca981528892
7
+ data.tar.gz: 9d40404a2fbbbc839a0bf2481adab4054ccb06f9cf4d6e401b6ad44cef333942b511f82f7acca9fe56175177ecff868330d15dc5987ebcf7c0e141bda60f92ef
@@ -60,6 +60,11 @@ module SendWithUsMailer
60
60
  @defaults = defaults.merge(value)
61
61
  end
62
62
 
63
+ # Inherit defaults from ancestor
64
+ def inherited(heir)
65
+ heir.__send__(:default, defaults)
66
+ end
67
+
63
68
  # Return the mailer methods that are defined in any instance
64
69
  # of <tt>SendWithUsMailer::Base</tt>. There should not be
65
70
  # any reason to call this directly.
@@ -1,3 +1,3 @@
1
1
  module SendWithUsMailer
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -47,13 +47,22 @@ describe SendWithUsMailer do
47
47
 
48
48
  describe "using default to set a parameter" do
49
49
  class MailerWithDefault < SendWithUsMailer::Base
50
- default email_id: 'def-4bBEddKbhKBu5xsU2p58KX'
50
+ default email_id: 'def-4bBEddKbhKBu5xsU2p58KX',
51
+ from_address: 'from@mailer_with_default.com',
52
+ reply_to: 'reply_to@mailer_with_default.com'
51
53
 
52
54
  def send_an_email
53
55
  mail recipient_address: 'def-dave@example.com'
54
56
  end
55
57
  end
56
58
 
59
+ class InheritDefaultsMailer < MailerWithDefault
60
+ end
61
+
62
+ class ReplacedDefaultsMailer < MailerWithDefault
63
+ default from_address: 'from@replaced_defaults_mailer.com'
64
+ end
65
+
57
66
  it "sets the email_id" do
58
67
  mail = MailerWithDefault.send_an_email
59
68
  mail.email_id.must_equal 'def-4bBEddKbhKBu5xsU2p58KX'
@@ -63,6 +72,19 @@ describe SendWithUsMailer do
63
72
  mail = MailerWithDefault.send_an_email
64
73
  mail.to[:address].must_equal 'def-dave@example.com'
65
74
  end
75
+
76
+ it "inherits defaults from ancestor" do
77
+ InheritDefaultsMailer.defaults[:from_address].must_equal 'from@mailer_with_default.com'
78
+ InheritDefaultsMailer.defaults[:reply_to].must_equal 'reply_to@mailer_with_default.com'
79
+ end
80
+
81
+ it "replaces ancestor defaults by own" do
82
+ ReplacedDefaultsMailer.defaults[:from_address].must_equal 'from@replaced_defaults_mailer.com'
83
+ end
84
+
85
+ it "uses ancestors defaults that has not been replaced by own" do
86
+ ReplacedDefaultsMailer.defaults[:reply_to].must_equal 'reply_to@mailer_with_default.com'
87
+ end
66
88
  end
67
89
 
68
90
  describe "all parameters can be set by default" do
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendwithus_ruby_action_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Rempel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-15 00:00:00.000000000 Z
11
+ date: 2015-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: send_with_us
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.9.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.9.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest-colorize
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mocha
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: |-
@@ -76,7 +76,7 @@ executables: []
76
76
  extensions: []
77
77
  extra_rdoc_files: []
78
78
  files:
79
- - .gitignore
79
+ - ".gitignore"
80
80
  - Gemfile
81
81
  - LICENSE.txt
82
82
  - README.md
@@ -100,17 +100,17 @@ require_paths:
100
100
  - lib
101
101
  required_ruby_version: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - '>='
103
+ - - ">="
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.0.14
113
+ rubygems_version: 2.2.2
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: An ActionMailer look alike for Send With Us.