Sha256: 1fd2a1b925158bd7f47b94d83bc83e567df7500873b830c4430f6cf0bee79cee

Contents?: true

Size: 414 Bytes

Versions: 2

Compression:

Stored size: 414 Bytes

Contents

require_relative "test_helper"

class SuggestedIndexesTest < Minitest::Test
  def setup
    PgHero.reset_query_stats
  end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pghero-1.2.1 test/suggested_indexes_test.rb
pghero-1.2.0 test/suggested_indexes_test.rb