Sha256: 9d8e3645a9ab166a6799054cfecff8475bc9e4af872cb7e31779158d1f6fd044

Contents?: true

Size: 520 Bytes

Versions: 6

Compression:

Stored size: 520 Bytes

Contents

require 'spec_helper'

require 'rom/sql/support/active_support_notifications'
require 'active_support/log_subscriber'

describe 'ActiveSupport::Notifications support' do
  include_context 'database setup'

  it 'works' do
    rom.gateways[:default].use_logger(LOGGER)

    sql = nil

    ActiveSupport::Notifications.subscribe('sql.rom') do |*, payload|
      sql = payload[:sql]
    end

    query = %(SELECT * FROM "users" WHERE name = 'notification test')
    conn.run(query)

    expect(sql).to eql(query)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rom-sql-0.6.1 spec/support/active_support_notifications_spec.rb
rom-sql-0.6.0 spec/support/active_support_notifications_spec.rb
rom-sql-0.6.0.rc1 spec/support/active_support_notifications_spec.rb
rom-sql-0.6.0.beta1 spec/support/active_support_notifications_spec.rb
rom-sql-0.5.3 spec/support/active_support_notifications_spec.rb
rom-sql-0.5.2 spec/support/active_support_notifications_spec.rb