Sha256: 6b74401e7b89e957f8bbe3820cfba8c2beeaa12223a2acfc11f8729e173d6d21

Contents?: true

Size: 531 Bytes

Versions: 40

Compression:

Stored size: 531 Bytes

Contents

require 'rails_helper'
require 'sorbet-rails/utils'

RSpec.describe SorbetRails::Utils do
  it 'loads all the models in the app' do
    expected_models = [
      Potion,
      SpellBook,
      Wand,
      Wizard,
    ]

    if Object.const_defined?('ActiveStorage')
      expected_models += [
        ActiveStorage::Attachment,
        ActiveStorage::Blob,
      ]
    end

    SorbetRails::Utils.rails_eager_load_all!
    all_models = ActiveRecord::Base.descendants
    expect((expected_models - all_models)).to eql([])
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
sorbet-rails-0.7.34 spec/utils_spec.rb
sorbet-rails-0.7.33 spec/utils_spec.rb
sorbet-rails-0.7.32 spec/utils_spec.rb
sorbet-rails-0.7.31 spec/utils_spec.rb
sorbet-rails-0.7.27 spec/utils_spec.rb
sorbet-rails-0.7.26 spec/utils_spec.rb
sorbet-rails-0.7.25 spec/utils_spec.rb
sorbet-rails-0.7.24 spec/utils_spec.rb
sorbet-rails-0.7.23 spec/utils_spec.rb
sorbet-rails-0.7.22 spec/utils_spec.rb
sorbet-rails-0.7.20 spec/utils_spec.rb
sorbet-rails-0.7.19 spec/utils_spec.rb
sorbet-rails-0.7.18 spec/utils_spec.rb
sorbet-rails-0.7.5 spec/utils_spec.rb
sorbet-rails-0.7.4 spec/utils_spec.rb
sorbet-rails-0.7.3 spec/utils_spec.rb
sorbet-rails-0.7.2 spec/utils_spec.rb
sorbet-rails-0.7.1 spec/utils_spec.rb
sorbet-rails-0.7.0 spec/utils_spec.rb
sorbet-rails-0.6.5.1 spec/utils_spec.rb