spec/datadog/notifications/plugins/grape_spec.rb in datadog-notifications-0.6.7 vs spec/datadog/notifications/plugins/grape_spec.rb in datadog-notifications-0.7.0
- old
+ new
@@ -39,60 +39,60 @@
it 'sends an increment and timing event for each request' do
get '/echo/1/1234'
expect(last_response.status).to eq(200)
expect(last_response.body).to eq('1 1234')
- expect(buffered).to eq([
+ expect(messages).to eq([
'api.request:1|c|#custom:tag,env:test,host:test.host,more:tags,method:GET,status:200,path:/echo/KEY1/KEY2',
- 'api.request.time:333|ms|#custom:tag,env:test,host:test.host,more:tags,method:GET,status:200,path:/echo/KEY1/KEY2',
+ 'api.request.time:111.0|ms|#custom:tag,env:test,host:test.host,more:tags,method:GET,status:200,path:/echo/KEY1/KEY2',
])
end
it 'supports namespaces and versioning' do
get '/api/v1/sub/versioned.txt'
expect(last_response.status).to eq(200)
expect(last_response.body).to eq('OK')
- expect(buffered).to eq([
+ expect(messages).to eq([
'api.request:1|c|#custom:tag,env:test,host:test.host,more:tags,method:GET,status:200,path:/api/sub/versioned,version:v1',
- 'api.request.time:333|ms|#custom:tag,env:test,host:test.host,more:tags,method:GET,status:200,path:/api/sub/versioned,version:v1',
+ 'api.request.time:111.0|ms|#custom:tag,env:test,host:test.host,more:tags,method:GET,status:200,path:/api/sub/versioned,version:v1',
])
end
it 'supports deep nesting' do
get '/sub/secure/resource'
expect(last_response.status).to eq(403)
expect(last_response.body).to eq('forbidden')
- expect(buffered).to eq([
+ expect(messages).to eq([
'api.request:1|c|#custom:tag,env:test,host:test.host,more:tags,method:GET,status:403,path:/sub/secure/resource',
- 'api.request.time:333|ms|#custom:tag,env:test,host:test.host,more:tags,method:GET,status:403,path:/sub/secure/resource',
+ 'api.request.time:111.0|ms|#custom:tag,env:test,host:test.host,more:tags,method:GET,status:403,path:/sub/secure/resource',
])
end
it 'handles rescued errors' do
get '/rescued'
expect(last_response.status).to eq(401)
- expect(buffered).to eq([
+ expect(messages).to eq([
'api.request:1|c|#custom:tag,env:test,host:test.host,more:tags,method:GET,status:401,path:/rescued',
- 'api.request.time:333|ms|#custom:tag,env:test,host:test.host,more:tags,method:GET,status:401,path:/rescued',
+ 'api.request.time:111.0|ms|#custom:tag,env:test,host:test.host,more:tags,method:GET,status:401,path:/rescued',
])
end
it 'handles invalid method' do
post '/rescued'
expect(last_response.status).to eq(405)
- expect(buffered).to eq([
+ expect(messages).to eq([
'api.request:1|c|#custom:tag,env:test,host:test.host,more:tags,method:POST,status:405,path:/rescued',
- 'api.request.time:333|ms|#custom:tag,env:test,host:test.host,more:tags,method:POST,status:405,path:/rescued',
+ 'api.request.time:111.0|ms|#custom:tag,env:test,host:test.host,more:tags,method:POST,status:405,path:/rescued',
])
end
it 'does not report paths on 404s' do
get '/sub/missing'
expect(last_response.status).to eq(404)
- expect(buffered).to eq([])
+ expect(messages).to eq([])
end
end