cmor_contact 0.0.42.pre → 0.0.43.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,13 +6,11 @@ RSpec.describe Cmor::Contact::ContactRequestMailer, type: :mailer do
6
6
 
7
7
  let(:contact_request) { create(:cmor_contact_contact_request) }
8
8
 
9
- let(:sender) { [contact_request.email] }
10
9
  let(:recipients) { Cmor::Contact::Configuration.recipients.call(Rails.env) }
11
10
  let(:mail_subject) { "[Dummy] Neue Kontaktanfrage" }
12
11
 
13
12
  subject { described_class.notify(contact_request) }
14
13
 
15
- it { expect(subject.from).to eq(sender) }
16
14
  it { expect(subject.to).to eq(recipients) }
17
15
  it { expect(subject.subject).to eq(mail_subject) }
18
16
 
@@ -20,5 +18,25 @@ RSpec.describe Cmor::Contact::ContactRequestMailer, type: :mailer do
20
18
  it { expect(subject.body.encoded).to include(contact_request.class.human_attribute_name(attribute)) }
21
19
  it { expect(subject.body.encoded).to include(contact_request.send(attribute).to_s) }
22
20
  end
21
+
22
+ context 'with Configuration.sender defaults' do
23
+ let(:sender) { [contact_request.email] }
24
+
25
+ it { expect(subject.from).to eq(sender) }
26
+ end
27
+
28
+ context 'with configured Configuration.sender' do
29
+ let(:sender) { "contact@example.com" }
30
+
31
+ around(:each) do |example|
32
+ original_sender = Cmor::Contact::Configuration.sender
33
+
34
+ Cmor::Contact::Configuration.sender = ->(contact_request) { sender }
35
+ example.run
36
+ Cmor::Contact::Configuration.sender = original_sender
37
+ end
38
+
39
+ it { expect(subject.from).to eq([sender]) }
40
+ end
23
41
  end
24
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cmor_contact
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.42.pre
4
+ version: 0.0.43.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-21 00:00:00.000000000 Z
11
+ date: 2020-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.42.pre
33
+ version: 0.0.43.pre
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.42.pre
40
+ version: 0.0.43.pre
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cmor_core_frontend
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.42.pre
47
+ version: 0.0.43.pre
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.42.pre
54
+ version: 0.0.43.pre
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sqlite3
57
57
  requirement: !ruby/object:Gem::Requirement