Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5566

Fix breaking app_spec.rb when Rails 7+ already installed

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 9.0.0
    • Affects Version/s: None
    • Component/s: Tests
    • Labels:
      None

      When attempting to run spec/integration/app_spec.rb locally, the tests will fail if you already have Rails 7+ installed. This is because the tests assume you're testing with Rails 6 by default, but when the tests run rails new, it picks up the Rails 7 version. This results in the scaffolding being built out with Rails 7 features, and when the app is then run against Rails 6, it fails to boot because of references to those newer features.

      The solution is to force rails new to reference the correct Rails version to use, e.g.

      $ rails _6.1.7.2_ new ...

      With this, rails new builds the correct scaffolding and the tests are able to pass.

            Assignee:
            jamis.buck@mongodb.com Jamis Buck
            Reporter:
            jamis.buck@mongodb.com Jamis Buck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: