Skip to content

Commit

Permalink
Support 'alias' calls in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitpaulk committed May 27, 2019
1 parent 8b4dca9 commit c13ff43
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/analytics
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ command :send do |c|
c.option '--traits=<traits>', 'the identify/group traits to send (JSON-encoded)'

c.option '--groupId=<groupId>', String, 'the group id'
c.option '--previousId=<previousId>', String, 'the previous id'

c.action do |args, options|
Analytics = Segment::Analytics.new({
Expand Down Expand Up @@ -91,6 +92,14 @@ command :send do |c|
context: json_hash(options.context),
integrations: json_hash(options.integrations)
})
when "alias"
Analytics.alias({
previous_id: options.previousId,
user_id: options.userId,
anonymous_id: options.anonymousId,
context: json_hash(options.context),
integrations: json_hash(options.integrations)
})
else
raise "Invalid Message Type #{options.type}"
end
Expand Down

0 comments on commit c13ff43

Please sign in to comment.