Fix breaking app_spec.rb when Rails 7+ already installed

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor - P4
    • 9.0.0
    • Affects Version/s: None
    • Component/s: Tests
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Jamis Buck
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: