Sha256: 36951406be172589ce383f9bd9cd81c5c0589b540dcddb14bcbb0c0f74bb354a

Contents?: true

Size: 522 Bytes

Versions: 11

Compression:

Stored size: 522 Bytes

Contents

require_relative "test_helper"

class SuggestedIndexesTest < Minitest::Test
  def setup
    skip if ENV["TRAVIS_CI"]
    PgHero.reset_query_stats
  end

  def test_basic
    User.where(email: "person1@example.org").first
    assert_equal [{table: "users", columns: ["email"]}], PgHero.suggested_indexes.map { |q| q.except(:queries, :details) }
  end

  def test_existing_index
    User.where("updated_at > ?", Time.now).to_a
    assert_equal [], PgHero.suggested_indexes.map { |q| q.except(:queries, :details) }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pghero-2.1.1 test/suggested_indexes_test.rb
pghero-2.1.0 test/suggested_indexes_test.rb
pghero-2.0.8 test/suggested_indexes_test.rb
pghero-2.0.7 test/suggested_indexes_test.rb
pghero-2.0.6 test/suggested_indexes_test.rb
pghero-2.0.5 test/suggested_indexes_test.rb
pghero-2.0.4 test/suggested_indexes_test.rb
pghero-2.0.3 test/suggested_indexes_test.rb
pghero-2.0.2 test/suggested_indexes_test.rb
pghero-2.0.1 test/suggested_indexes_test.rb
pghero-2.0.0 test/suggested_indexes_test.rb