Sha256: eae72678cf4605bdaecf8e73538707fb234ade7dc6557c162138a35688aaf6b8

Contents?: true

Size: 554 Bytes

Versions: 16

Compression:

Stored size: 554 Bytes

Contents

require 'spec_helper'

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

  include_context 'users'

  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

16 entries across 16 versions & 1 rubygems

Version Path
rom-sql-1.3.5 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.3.4 spec/integration/support/active_support_notifications_spec.rb
rom-sql-2.0.0.beta2 spec/integration/support/active_support_notifications_spec.rb
rom-sql-2.0.0.beta1 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.3.3 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.3.2 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.3.1 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.3.0 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.2.2 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.2.1 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.2.0 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.1.2 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.1.1 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.1.0 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.0.3 spec/integration/support/active_support_notifications_spec.rb
rom-sql-1.0.2 spec/integration/support/active_support_notifications_spec.rb