Sha256: 953a0deaed732141f0f790da1f92e8e8862ea05c9c66544bd886b2348b4c37df

Contents?: true

Size: 682 Bytes

Versions: 2

Compression:

Stored size: 682 Bytes

Contents

require 'spec_helper'

describe Datadog::Notifications::Plugins::ActiveRecord do
  it 'sends an increment and timing event for each query' do
    Post.all.to_a
    expect(buffered).to eq [
      'activerecord.sql:1|c|#custom:tag,env:test,host:test.host,query:post.load',
      'activerecord.sql.time:333|ms|#custom:tag,env:test,host:test.host,query:post.load',
    ]
  end

  it 'supports custom queries' do
    Post.find_by_sql('SELECT * FROM posts LIMIT 1').to_a
    expect(buffered).to eq [
      'activerecord.sql:1|c|#custom:tag,env:test,host:test.host,query:post.load',
      'activerecord.sql.time:333|ms|#custom:tag,env:test,host:test.host,query:post.load',
    ]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
datadog-notifications-0.6.7 spec/datadog/notifications/plugins/active_record_spec.rb
datadog-notifications-0.6.6 spec/datadog/notifications/plugins/active_record_spec.rb