Sha256: 5d61ab134d37a10feb7548abc751738895803e2d8b7432a8012ee24896e13ff0

Contents?: true

Size: 343 Bytes

Versions: 2

Compression:

Stored size: 343 Bytes

Contents

# frozen_string_literal: true

RSpec.describe "model_indexes_cats" do
  it "randomly selects from cats" do
    expect(Cat.all.to_sql).to end_with("ORDER BY RANDOM()")
  end

  it "nonrandomly selects from cats by implied primary key descending" do
    expect(Cat.all.order(id: :desc).to_sql).to end_with('ORDER BY "cats"."id" DESC')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unreliable-0.9.1 spec/model_indexes_cats_spec.rb
unreliable-0.9.0 spec/model_indexes_cats_spec.rb