Sha256: b0a7812b84ae3ad847e5683e21e232c92fdccc4491c15f4252c23f867fbfce77

Contents?: true

Size: 549 Bytes

Versions: 9

Compression:

Stored size: 549 Bytes

Contents

require 'spec_helper'

RSpec.describe 'ActiveSupport::Notifications support', :postgres do
  before do
    ROM::SQL.load_extensions(:active_support_notifications, :rails_log_subscriber)
  end

  include_context 'database setup'

  it 'works' do
    container.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

9 entries across 9 versions & 1 rubygems

Version Path
rom-sql-1.0.1 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.0.0 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.0.0.rc2 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.0.0.rc1 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.0.0.beta3 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.0.0.beta2 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.0.0.beta1 spec/integration/support/active_support_notifications_spec.rb
rom-sql-0.9.1 spec/integration/support/active_support_notifications_spec.rb
rom-sql-0.9.0 spec/integration/support/active_support_notifications_spec.rb