vero 0.9.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +15 -1
- data/Gemfile.lock +95 -73
- data/README.markdown +145 -121
- data/lib/generators/vero_generator.rb +18 -19
- data/lib/vero.rb +7 -3
- data/lib/vero/api.rb +14 -4
- data/lib/vero/api/base_api.rb +11 -10
- data/lib/vero/api/events/track_api.rb +5 -3
- data/lib/vero/api/users/delete_api.rb +21 -0
- data/lib/vero/api/users/edit_api.rb +5 -3
- data/lib/vero/api/users/edit_tags_api.rb +7 -5
- data/lib/vero/api/users/reidentify_api.rb +5 -3
- data/lib/vero/api/users/resubscribe_api.rb +3 -1
- data/lib/vero/api/users/track_api.rb +5 -3
- data/lib/vero/api/users/unsubscribe_api.rb +3 -1
- data/lib/vero/app.rb +4 -2
- data/lib/vero/config.rb +11 -8
- data/lib/vero/context.rb +9 -11
- data/lib/vero/context/api.rb +9 -7
- data/lib/vero/dsl.rb +3 -1
- data/lib/vero/railtie.rb +5 -3
- data/lib/vero/sender.rb +12 -31
- data/lib/vero/senders/base.rb +3 -1
- data/lib/vero/senders/delayed_job.rb +7 -7
- data/lib/vero/senders/invalid.rb +5 -3
- data/lib/vero/senders/resque.rb +8 -8
- data/lib/vero/senders/sidekiq.rb +3 -1
- data/lib/vero/senders/{thread.rb → sucker_punch.rb} +5 -3
- data/lib/vero/trackable.rb +4 -2
- data/lib/vero/trackable/base.rb +10 -9
- data/lib/vero/trackable/interface.rb +3 -1
- data/lib/vero/utility/ext.rb +3 -1
- data/lib/vero/utility/logger.rb +4 -6
- data/lib/vero/version.rb +3 -1
- data/lib/vero/view_helpers/javascript.rb +20 -20
- data/spec/lib/api/base_api_spec.rb +10 -8
- data/spec/lib/api/events/track_api_spec.rb +23 -21
- data/spec/lib/api/users/delete_api_spec.rb +33 -0
- data/spec/lib/api/users/edit_api_spec.rb +12 -10
- data/spec/lib/api/users/edit_tags_api_spec.rb +22 -20
- data/spec/lib/api/users/reidentify_spec.rb +16 -14
- data/spec/lib/api/users/resubscribe_api_spec.rb +16 -10
- data/spec/lib/api/users/track_api_spec.rb +21 -19
- data/spec/lib/api/users/unsubscribe_api_spec.rb +12 -10
- data/spec/lib/api_spec.rb +29 -24
- data/spec/lib/app_spec.rb +12 -10
- data/spec/lib/config_spec.rb +31 -29
- data/spec/lib/context_spec.rb +13 -11
- data/spec/lib/dsl_spec.rb +3 -1
- data/spec/lib/sender_spec.rb +12 -24
- data/spec/lib/senders/sidekiq_spec.rb +16 -9
- data/spec/lib/trackable_spec.rb +88 -114
- data/spec/lib/view_helpers_spec.rb +12 -8
- data/spec/spec_helper.rb +10 -4
- data/spec/support/base_config_shared_examples.rb +5 -3
- data/spec/support/user_support.rb +15 -7
- data/spec/support/vero_user_support.rb +4 -2
- data/vero.gemspec +14 -30
- metadata +30 -125
@@ -1,32 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Vero::Api::Workers::Users::UnsubscribeAPI do
|
4
|
-
subject { Vero::Api::Workers::Users::UnsubscribeAPI.new('https://api.getvero.com', {:
|
6
|
+
subject { Vero::Api::Workers::Users::UnsubscribeAPI.new('https://api.getvero.com', { auth_token: 'abcd', email: 'test@test.com', changes: { email: 'test@test.com' } }) }
|
5
7
|
|
6
|
-
it_behaves_like
|
7
|
-
let(:end_point) {
|
8
|
+
it_behaves_like 'a Vero wrapper' do
|
9
|
+
let(:end_point) { '/api/v2/users/unsubscribe.json' }
|
8
10
|
end
|
9
11
|
|
10
12
|
describe :validate! do
|
11
|
-
it
|
12
|
-
options = {
|
13
|
+
it 'should not raise an error when the keys are Strings' do
|
14
|
+
options = { 'auth_token' => 'abcd', 'email' => 'test@test.com', 'changes' => { 'email' => 'test@test.com' } }
|
13
15
|
subject.options = options
|
14
16
|
expect { subject.send(:validate!) }.to_not raise_error
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
18
20
|
describe :request do
|
19
|
-
it
|
20
|
-
expect(RestClient).to receive(:post).with(
|
21
|
+
it 'should send a request to the Vero API' do
|
22
|
+
expect(RestClient).to receive(:post).with('https://api.getvero.com/api/v2/users/unsubscribe.json', { auth_token: 'abcd', email: 'test@test.com', changes: { email: 'test@test.com' } })
|
21
23
|
allow(RestClient).to receive(:post).and_return(200)
|
22
24
|
subject.send(:request)
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
26
|
-
describe
|
27
|
-
it
|
28
|
+
describe 'integration test' do
|
29
|
+
it 'should not raise any errors' do
|
28
30
|
allow(RestClient).to receive(:post).and_return(200)
|
29
31
|
expect { subject.perform }.to_not raise_error
|
30
32
|
end
|
31
33
|
end
|
32
|
-
end
|
34
|
+
end
|
data/spec/lib/api_spec.rb
CHANGED
@@ -1,21 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Vero::Api::Events do
|
4
|
-
let
|
6
|
+
let(:subject) { Vero::Api::Events }
|
5
7
|
|
6
8
|
describe :track! do
|
7
|
-
it
|
8
|
-
input = {:
|
9
|
-
expected = input.merge(:
|
9
|
+
it 'should call the TrackAPI object via the configured sender' do
|
10
|
+
input = { event_name: 'test_event', identity: { email: 'james@getvero.com' }, data: { test: 'test' } }
|
11
|
+
expected = input.merge(auth_token: 'abc123', development_mode: true)
|
10
12
|
|
11
13
|
mock_context = Vero::Context.new
|
12
14
|
allow(mock_context.config).to receive(:configured?).and_return(true)
|
13
|
-
allow(mock_context.config).to receive(:auth_token).and_return(
|
15
|
+
allow(mock_context.config).to receive(:auth_token).and_return('abc123')
|
14
16
|
allow(mock_context.config).to receive(:development_mode).and_return(true)
|
15
17
|
|
16
18
|
allow(Vero::App).to receive(:default_context).and_return(mock_context)
|
17
19
|
|
18
|
-
expect(Vero::Sender).to receive(:send).with(Vero::Api::Workers::Events::TrackAPI, true,
|
20
|
+
expect(Vero::Sender).to receive(:send).with(Vero::Api::Workers::Events::TrackAPI, true, 'https://api.getvero.com', expected)
|
19
21
|
|
20
22
|
subject.track!(input)
|
21
23
|
end
|
@@ -25,67 +27,70 @@ end
|
|
25
27
|
describe Vero::Api::Users do
|
26
28
|
let(:subject) { Vero::Api::Users }
|
27
29
|
let(:mock_context) { Vero::Context.new }
|
28
|
-
let(:expected) { input.merge(:
|
30
|
+
let(:expected) { input.merge(auth_token: 'abc123', development_mode: true) }
|
29
31
|
|
30
32
|
before :each do
|
31
33
|
allow(mock_context.config).to receive(:configured?).and_return(true)
|
32
|
-
allow(mock_context.config).to receive(:auth_token).and_return(
|
34
|
+
allow(mock_context.config).to receive(:auth_token).and_return('abc123')
|
33
35
|
allow(mock_context.config).to receive(:development_mode).and_return(true)
|
34
36
|
allow(Vero::App).to receive(:default_context).and_return(mock_context)
|
35
37
|
end
|
36
38
|
|
37
39
|
describe :track! do
|
38
|
-
context
|
39
|
-
let(:input) { {:
|
40
|
+
context 'should call the TrackAPI object via the configured sender' do
|
41
|
+
let(:input) { { email: 'james@getvero.com', data: { age: 25 } } }
|
40
42
|
|
41
43
|
specify do
|
42
|
-
expect(Vero::Sender).to receive(:send).with(Vero::Api::Workers::Users::TrackAPI, true,
|
44
|
+
expect(Vero::Sender).to receive(:send).with(Vero::Api::Workers::Users::TrackAPI, true, 'https://api.getvero.com', expected)
|
43
45
|
subject.track!(input)
|
44
46
|
end
|
45
47
|
end
|
46
48
|
end
|
47
49
|
|
48
50
|
describe :edit_user! do
|
49
|
-
context
|
50
|
-
let(:input) { {:
|
51
|
+
context 'should call the TrackAPI object via the configured sender' do
|
52
|
+
let(:input) { { email: 'james@getvero.com', changes: { age: 25 } } }
|
51
53
|
|
52
54
|
specify do
|
53
|
-
expect(Vero::Sender).to receive(:send).with(Vero::Api::Workers::Users::EditAPI, true,
|
55
|
+
expect(Vero::Sender).to receive(:send).with(Vero::Api::Workers::Users::EditAPI, true, 'https://api.getvero.com', expected)
|
54
56
|
subject.edit_user!(input)
|
55
57
|
end
|
56
58
|
end
|
57
59
|
end
|
58
60
|
|
59
61
|
describe :edit_user_tags! do
|
60
|
-
context
|
61
|
-
let(:input) { {:
|
62
|
+
context 'should call the TrackAPI object via the configured sender' do
|
63
|
+
let(:input) { { add: ['boom'], remove: ['tish'] } }
|
62
64
|
|
63
65
|
specify do
|
64
|
-
expect(Vero::Sender).to receive(:send).with(Vero::Api::Workers::Users::EditTagsAPI, true,
|
66
|
+
expect(Vero::Sender).to receive(:send).with(Vero::Api::Workers::Users::EditTagsAPI, true, 'https://api.getvero.com', expected)
|
65
67
|
subject.edit_user_tags!(input)
|
66
68
|
end
|
67
69
|
end
|
68
70
|
end
|
69
71
|
|
70
72
|
describe :unsubscribe! do
|
71
|
-
context
|
72
|
-
let(:input) { {:
|
73
|
+
context 'should call the TrackAPI object via the configured sender' do
|
74
|
+
let(:input) { { email: 'james@getvero' } }
|
73
75
|
|
74
76
|
specify do
|
75
|
-
expect(Vero::Sender).to receive(:send).with(Vero::Api::Workers::Users::UnsubscribeAPI, true,
|
77
|
+
expect(Vero::Sender).to receive(:send).with(Vero::Api::Workers::Users::UnsubscribeAPI, true, 'https://api.getvero.com', expected)
|
76
78
|
subject.unsubscribe!(input)
|
77
79
|
end
|
78
80
|
end
|
79
81
|
end
|
80
82
|
|
81
83
|
describe :resubscribe! do
|
82
|
-
context
|
83
|
-
let(:input) { {:
|
84
|
+
context 'should call the TrackAPI object via the configured sender' do
|
85
|
+
let(:input) { { email: 'james@getvero' } }
|
84
86
|
|
85
87
|
specify do
|
86
|
-
Vero::Sender
|
88
|
+
expect(Vero::Sender).to(
|
89
|
+
receive(:send)
|
90
|
+
.with(Vero::Api::Workers::Users::ResubscribeAPI, true, 'https://api.getvero.com', expected)
|
91
|
+
)
|
87
92
|
subject.resubscribe!(input)
|
88
93
|
end
|
89
94
|
end
|
90
95
|
end
|
91
|
-
end
|
96
|
+
end
|
data/spec/lib/app_spec.rb
CHANGED
@@ -1,31 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Vero::App do
|
4
6
|
describe 'self.default_context' do
|
5
|
-
it
|
7
|
+
it 'inherits from Vero::Context' do
|
6
8
|
actual = Vero::App.default_context
|
7
9
|
expect(actual).to be_a(Vero::Context)
|
8
10
|
end
|
9
11
|
end
|
10
12
|
|
11
|
-
let
|
13
|
+
let(:context) { Vero::App.default_context }
|
12
14
|
describe :init do
|
13
|
-
it
|
15
|
+
it 'should ignore configuring the config if no block is provided' do
|
14
16
|
Vero::App.init
|
15
17
|
expect(context.configured?).to be(false)
|
16
18
|
end
|
17
19
|
|
18
|
-
it
|
20
|
+
it 'should pass configuration defined in the block to the config file' do
|
19
21
|
Vero::App.init
|
20
22
|
|
21
23
|
expect(context.config.api_key).to be_nil
|
22
24
|
Vero::App.init do |c|
|
23
|
-
c.api_key =
|
25
|
+
c.api_key = 'abcd1234'
|
24
26
|
end
|
25
|
-
expect(context.config.api_key).to eq(
|
27
|
+
expect(context.config.api_key).to eq('abcd1234')
|
26
28
|
end
|
27
29
|
|
28
|
-
it
|
30
|
+
it 'should init should be able to set async' do
|
29
31
|
Vero::App.init do |c|
|
30
32
|
c.async = false
|
31
33
|
end
|
@@ -39,7 +41,7 @@ describe Vero::App do
|
|
39
41
|
end
|
40
42
|
|
41
43
|
describe :disable_requests! do
|
42
|
-
it
|
44
|
+
it 'should change config.disabled' do
|
43
45
|
Vero::App.init {}
|
44
46
|
expect(context.config.disabled).to be(false)
|
45
47
|
|
@@ -49,10 +51,10 @@ describe Vero::App do
|
|
49
51
|
end
|
50
52
|
|
51
53
|
describe :log do
|
52
|
-
it
|
54
|
+
it 'should have a log method' do
|
53
55
|
Vero::App.init {}
|
54
56
|
expect(Vero::App).to receive(:log)
|
55
|
-
Vero::App.log(Object,
|
57
|
+
Vero::App.log(Object, 'test')
|
56
58
|
end
|
57
59
|
end
|
58
60
|
end
|
data/spec/lib/config_spec.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Vero::Config do
|
4
6
|
let(:config) { Vero::Config.new }
|
5
7
|
|
6
|
-
it
|
8
|
+
it 'should be async by default' do
|
7
9
|
expect(config.async).to be(true)
|
8
10
|
end
|
9
11
|
|
10
12
|
describe :reset! do
|
11
|
-
it
|
12
|
-
config.api_key =
|
13
|
-
config.secret =
|
13
|
+
it 'should reset all attributes' do
|
14
|
+
config.api_key = 'abcd1234'
|
15
|
+
config.secret = 'abcd1234'
|
14
16
|
config.reset!
|
15
17
|
|
16
18
|
expect(config.api_key).to be_nil
|
@@ -19,51 +21,51 @@ describe Vero::Config do
|
|
19
21
|
end
|
20
22
|
|
21
23
|
describe :auth_token do
|
22
|
-
it
|
24
|
+
it 'should return nil if either api_key or secret are not set' do
|
23
25
|
config.api_key = nil
|
24
|
-
config.secret =
|
26
|
+
config.secret = 'abcd'
|
25
27
|
expect(config.auth_token).to be_nil
|
26
28
|
|
27
|
-
config.api_key =
|
29
|
+
config.api_key = 'abcd'
|
28
30
|
config.secret = nil
|
29
31
|
expect(config.auth_token).to be_nil
|
30
32
|
|
31
|
-
config.api_key =
|
32
|
-
config.secret =
|
33
|
+
config.api_key = 'abcd'
|
34
|
+
config.secret = 'abcd'
|
33
35
|
expect(config.auth_token).not_to be_nil
|
34
36
|
end
|
35
37
|
|
36
|
-
it
|
37
|
-
config.api_key =
|
38
|
-
config.secret =
|
39
|
-
expect(config.auth_token).to eq(
|
38
|
+
it 'should return an expected auth_token' do
|
39
|
+
config.api_key = 'abcd1234'
|
40
|
+
config.secret = 'efgh5678'
|
41
|
+
expect(config.auth_token).to eq('YWJjZDEyMzQ6ZWZnaDU2Nzg=')
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
43
45
|
describe :request_params do
|
44
|
-
it
|
46
|
+
it 'should return a hash of auth_token and development_mode if they are set' do
|
45
47
|
config.api_key = nil
|
46
48
|
config.secret = nil
|
47
49
|
config.development_mode = nil
|
48
50
|
expect(config.request_params).to eq({})
|
49
51
|
|
50
|
-
config.api_key =
|
51
|
-
config.secret =
|
52
|
-
expect(config.request_params).to eq({:
|
52
|
+
config.api_key = 'abcd1234'
|
53
|
+
config.secret = 'abcd1234'
|
54
|
+
expect(config.request_params).to eq({ auth_token: 'YWJjZDEyMzQ6YWJjZDEyMzQ=' })
|
53
55
|
|
54
56
|
config.development_mode = true
|
55
|
-
expect(config.request_params).to eq({:
|
57
|
+
expect(config.request_params).to eq({ auth_token: 'YWJjZDEyMzQ6YWJjZDEyMzQ=', development_mode: true })
|
56
58
|
end
|
57
59
|
end
|
58
60
|
|
59
61
|
describe :domain do
|
60
|
-
it
|
62
|
+
it 'should return https://api.getvero.com when not set' do
|
61
63
|
expect(config.domain).to eq('https://api.getvero.com')
|
62
64
|
config.domain = 'blah.com'
|
63
65
|
expect(config.domain).not_to eq('https://api.getvero.com')
|
64
66
|
end
|
65
67
|
|
66
|
-
it
|
68
|
+
it 'should return the domain value' do
|
67
69
|
config.domain = 'test.unbelieveable.com.au'
|
68
70
|
expect(config.domain).to eq('http://test.unbelieveable.com.au')
|
69
71
|
|
@@ -73,24 +75,24 @@ describe Vero::Config do
|
|
73
75
|
end
|
74
76
|
|
75
77
|
describe :development_mode do
|
76
|
-
it
|
77
|
-
stub_env('development')
|
78
|
+
it 'by default it should return false regardless of Rails environment' do
|
79
|
+
stub_env('development') do
|
78
80
|
config = Vero::Config.new
|
79
81
|
expect(config.development_mode).to be(false)
|
80
|
-
|
82
|
+
end
|
81
83
|
|
82
|
-
stub_env('test')
|
84
|
+
stub_env('test') do
|
83
85
|
config = Vero::Config.new
|
84
86
|
expect(config.development_mode).to be(false)
|
85
|
-
|
87
|
+
end
|
86
88
|
|
87
|
-
stub_env('production')
|
89
|
+
stub_env('production') do
|
88
90
|
config = Vero::Config.new
|
89
91
|
expect(config.development_mode).to be(false)
|
90
|
-
|
92
|
+
end
|
91
93
|
end
|
92
94
|
|
93
|
-
it
|
95
|
+
it 'can be overritten with the config block' do
|
94
96
|
config.development_mode = true
|
95
97
|
expect(config.request_params[:development_mode]).to be(true)
|
96
98
|
|
@@ -101,7 +103,7 @@ describe Vero::Config do
|
|
101
103
|
|
102
104
|
describe :test_mode do
|
103
105
|
it 'should not raise error even though not configured properly' do
|
104
|
-
input = {:
|
106
|
+
input = { event_name: 'test_event' }
|
105
107
|
mock_context = Vero::Context.new
|
106
108
|
allow(mock_context.config).to receive(:configured?).and_return(false)
|
107
109
|
|
data/spec/lib/context_spec.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
|
-
describe Vero::Context do
|
5
|
+
describe Vero::Context do
|
4
6
|
let(:context) { Vero::Context.new }
|
5
7
|
|
6
|
-
it
|
7
|
-
context1 = Vero::Context.new({ :
|
8
|
+
it 'accepts multiple parameter types in contructor' do
|
9
|
+
context1 = Vero::Context.new({ api_key: 'blah', secret: 'didah' })
|
8
10
|
expect(context1).to be_a(Vero::Context)
|
9
11
|
expect(context1.config.api_key).to eq('blah')
|
10
12
|
expect(context1.config.secret).to eq('didah')
|
@@ -22,19 +24,19 @@ describe Vero::Context do
|
|
22
24
|
end
|
23
25
|
|
24
26
|
describe :configure do
|
25
|
-
it
|
27
|
+
it 'should ignore configuring the config if no block is provided' do
|
26
28
|
context.configure
|
27
29
|
expect(context.configured?).to be(false)
|
28
30
|
end
|
29
31
|
|
30
|
-
it
|
32
|
+
it 'should pass configuration defined in the block to the config file' do
|
31
33
|
context.configure do |c|
|
32
|
-
c.api_key =
|
34
|
+
c.api_key = 'abcd1234'
|
33
35
|
end
|
34
|
-
expect(context.config.api_key).to eq(
|
36
|
+
expect(context.config.api_key).to eq('abcd1234')
|
35
37
|
end
|
36
38
|
|
37
|
-
it
|
39
|
+
it 'should init should be able to set async' do
|
38
40
|
context.configure do |c|
|
39
41
|
c.async = false
|
40
42
|
end
|
@@ -48,10 +50,10 @@ describe Vero::Context do
|
|
48
50
|
end
|
49
51
|
|
50
52
|
describe :disable_requests! do
|
51
|
-
it
|
53
|
+
it 'should change config.disabled' do
|
52
54
|
expect(context.config.disabled).to be(false)
|
53
55
|
context.disable_requests!
|
54
|
-
expect(context.config.disabled).to be(true)
|
56
|
+
expect(context.config.disabled).to be(true)
|
55
57
|
end
|
56
58
|
end
|
57
|
-
end
|
59
|
+
end
|
data/spec/lib/dsl_spec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Vero::DSL do
|
@@ -18,7 +20,7 @@ describe Vero::DSL::Proxy do
|
|
18
20
|
expect(proxy.users).to eql(Vero::Api::Users)
|
19
21
|
end
|
20
22
|
|
21
|
-
it
|
23
|
+
it 'should respond to reidentify!' do
|
22
24
|
expect(proxy.users.respond_to?(:reidentify!)).to be(true)
|
23
25
|
end
|
24
26
|
end
|
data/spec/lib/sender_spec.rb
CHANGED
@@ -1,34 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Vero::Sender do
|
4
6
|
subject { Vero::Sender }
|
5
7
|
|
6
|
-
describe
|
7
|
-
it
|
8
|
-
expect(subject.senders).to
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should have a default set of senders (true, false, none, thread)" do
|
17
|
-
expect(subject.senders).to eq({
|
18
|
-
true => Vero::Senders::Thread,
|
19
|
-
false => Vero::Senders::Base,
|
20
|
-
:none => Vero::Senders::Base,
|
21
|
-
:thread => Vero::Senders::Thread,
|
22
|
-
})
|
23
|
-
end
|
8
|
+
describe '.senders' do
|
9
|
+
it 'should automatically find senders that are not defined' do
|
10
|
+
expect(subject.senders[:delayed_job]).to eq(Vero::Senders::DelayedJob)
|
11
|
+
expect(subject.senders[:sucker_punch]).to eq(Vero::Senders::SuckerPunch)
|
12
|
+
expect(subject.senders[:resque]).to eq(Vero::Senders::Resque)
|
13
|
+
expect(subject.senders[:sidekiq]).to eq(Vero::Senders::Sidekiq)
|
14
|
+
expect(subject.senders[:invalid]).to eq(Vero::Senders::Invalid)
|
15
|
+
expect(subject.senders[:none]).to eq(Vero::Senders::Base)
|
24
16
|
end
|
25
17
|
|
26
|
-
it
|
27
|
-
expect(subject.senders[:
|
28
|
-
expect(subject.senders[:resque]).to eq(Vero::Senders::Resque)
|
29
|
-
expect(subject.senders[:sidekiq]).to eq(Vero::Senders::Sidekiq)
|
30
|
-
expect(subject.senders[:invalid]).to eq(Vero::Senders::Invalid)
|
31
|
-
expect(subject.senders[:none]).to eq(Vero::Senders::Base)
|
18
|
+
it 'should fallback to Vero::Senders::Base' do
|
19
|
+
expect(subject.senders[:unsupported_sender]).to eq(Vero::Senders::Base)
|
32
20
|
end
|
33
21
|
end
|
34
22
|
end
|