-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: use tracking_api_key instead of the old api_key and secret
- Loading branch information
Showing
10 changed files
with
58 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Vero | ||
VERSION = '0.10.0' | ||
VERSION = '1.0.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,11 @@ | |
describe :track! do | ||
it 'should call the TrackAPI object via the configured sender' do | ||
input = { event_name: 'test_event', identity: { email: '[email protected]' }, data: { test: 'test' } } | ||
expected = input.merge(auth_token: 'abc123', development_mode: true) | ||
expected = input.merge(tracking_api_key: 'abc123', development_mode: true) | ||
|
||
mock_context = Vero::Context.new | ||
allow(mock_context.config).to receive(:configured?).and_return(true) | ||
allow(mock_context.config).to receive(:auth_token).and_return('abc123') | ||
allow(mock_context.config).to receive(:tracking_api_key).and_return('abc123') | ||
allow(mock_context.config).to receive(:development_mode).and_return(true) | ||
|
||
allow(Vero::App).to receive(:default_context).and_return(mock_context) | ||
|
@@ -27,11 +27,11 @@ | |
describe Vero::Api::Users do | ||
let(:subject) { Vero::Api::Users } | ||
let(:mock_context) { Vero::Context.new } | ||
let(:expected) { input.merge(auth_token: 'abc123', development_mode: true) } | ||
let(:expected) { input.merge(tracking_api_key: 'abc123', development_mode: true) } | ||
|
||
before :each do | ||
allow(mock_context.config).to receive(:configured?).and_return(true) | ||
allow(mock_context.config).to receive(:auth_token).and_return('abc123') | ||
allow(mock_context.config).to receive(:tracking_api_key).and_return('abc123') | ||
allow(mock_context.config).to receive(:development_mode).and_return(true) | ||
allow(Vero::App).to receive(:default_context).and_return(mock_context) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ def vero_context(user, logging = true, async = false, disabled = true) | |
before :each do | ||
@request_params = { | ||
event_name: 'test_event', | ||
auth_token: 'YWJjZDEyMzQ6ZWZnaDU2Nzg=', | ||
tracking_api_key: 'YWJjZDEyMzQ6ZWZnaDU2Nzg=', | ||
identity: { email: '[email protected]', age: 20, _user_type: 'User' }, | ||
data: { test: 1 }, | ||
development_mode: true | ||
|
@@ -40,8 +40,7 @@ def vero_context(user, logging = true, async = false, disabled = true) | |
context 'the gem has been configured' do | ||
before do | ||
Vero::App.init do |c| | ||
c.api_key = 'abcd1234' | ||
c.secret = 'efgh5678' | ||
c.tracking_api_key = 'YWJjZDEyMzQ6ZWZnaDU2Nzg=' | ||
c.async = false | ||
end | ||
end | ||
|
@@ -300,8 +299,8 @@ def vero_context(user, logging = true, async = false, disabled = true) | |
describe :with_vero_context do | ||
it 'should be able to change contexts' do | ||
user = User.new | ||
expect(user.with_default_vero_context.config.config_params).to eq({ api_key: 'abcd1234', secret: 'efgh5678' }) | ||
expect(user.with_vero_context({ api_key: 'boom', secret: 'tish' }).config.config_params).to eq({ api_key: 'boom', secret: 'tish' }) | ||
expect(user.with_default_vero_context.config.config_params).to eq({ tracking_api_key: 'YWJjZDEyMzQ6ZWZnaDU2Nzg=' }) | ||
expect(user.with_vero_context({ tracking_api_key: 'boom' }).config.config_params).to eq({ tracking_api_key: 'boom' }) | ||
end | ||
end | ||
|
||
|
@@ -310,7 +309,7 @@ def vero_context(user, logging = true, async = false, disabled = true) | |
|
||
request_params = { | ||
event_name: 'test_event', | ||
auth_token: 'YWJjZDEyMzQ6ZWZnaDU2Nzg=', | ||
tracking_api_key: 'YWJjZDEyMzQ6ZWZnaDU2Nzg=', | ||
identity: { email: '[email protected]', age: 20, _user_type: 'UserWithoutInterface' }, | ||
data: { test: 1 }, | ||
development_mode: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# frozen_string_literal: true | ||
|
||
VeroUser = Struct.new(:api_key, :secret) | ||
VeroUser = Struct.new(:tracking_api_key) |