Remove obsolete segmentation payload in editing-session request

This commit is contained in:
Shane Kilkelly 2018-03-05 11:15:41 +00:00
parent f625b22ec5
commit b3f47ea44a
3 changed files with 4 additions and 8 deletions

View file

@ -11,7 +11,7 @@ module.exports = AnalyticsController =
if userId? if userId?
GeoIpLookup.getDetails req.ip, (err, geoDetails) -> GeoIpLookup.getDetails req.ip, (err, geoDetails) ->
countryCode = geoDetails?.country_code || null countryCode = geoDetails?.country_code || null
AnalyticsManager.updateEditingSession userId, projectId, countryCode, {}, (error) -> AnalyticsManager.updateEditingSession userId, projectId, countryCode, (error) ->
respondWith(error, res, next) respondWith(error, res, next)
else else
res.send 204 res.send 204

View file

@ -43,7 +43,7 @@ module.exports =
opts.qs = {fromV2: 1} opts.qs = {fromV2: 1}
makeRequest opts, callback makeRequest opts, callback
updateEditingSession: (userId, projectId, countryCode, segmentation = {}, callback = (error) ->) -> updateEditingSession: (userId, projectId, countryCode, callback = (error) ->) ->
if userId+"" == settings.smokeTest?.userId+"" if userId+"" == settings.smokeTest?.userId+""
return callback() return callback()
query = query =
@ -52,9 +52,6 @@ module.exports =
if countryCode if countryCode
query.countryCode = countryCode query.countryCode = countryCode
opts = opts =
body:
segmentation: segmentation
json: true
method: "PUT" method: "PUT"
timeout: 1000 timeout: 1000
url: "/editingSession" url: "/editingSession"

View file

@ -14,7 +14,7 @@ describe 'AnalyticsController', ->
getLoggedInUserId: sinon.stub() getLoggedInUserId: sinon.stub()
@AnalyticsManager = @AnalyticsManager =
updateEditingSession: sinon.stub().callsArgWith(4) updateEditingSession: sinon.stub().callsArgWith(3)
recordEvent: sinon.stub().callsArgWith(3) recordEvent: sinon.stub().callsArgWith(3)
@controller = SandboxedModule.require modulePath, requires: @controller = SandboxedModule.require modulePath, requires:
@ -43,8 +43,7 @@ describe 'AnalyticsController', ->
@AnalyticsManager.updateEditingSession.calledWith( @AnalyticsManager.updateEditingSession.calledWith(
"1234", "1234",
"a project id", "a project id",
'XY', 'XY'
{}
).should.equal true ).should.equal true
done() done()