Rails 6 is released! Rspec-rails needs some tweaking to work

David Heinemeier Hansson announced on the Rails blog that Rails 6.0 is released, which makes it one of the chunkiest new releases I can remember – lots of exciting stuff to get used to, including Webpacker in the deployment pipeline by default, parallel databases, Trix now fully integrated into the framework as Action Text, and major improvements to existing features.

Rails 6.0: Action Mailbox, Action Text, Multiple DBs, Parallel Testing, Webpacker by default, and Zeitwerk – Dealing with incoming email, composing rich-text content, connecting to multiple databases, parallelizing test runs, integrating JavaScript with love, and rewriting the code loader.

I’ve just installed it and it’s obvious how much thought and care has gone into the new version.

Hit a hurdle with running Rspec straight out the gate though, an error

ActionView::Template::Error wrong number of arguments (given 2, expected 1)

but found the issue had been identified and fixed in a patch to the new version 4.0 of rspec-rails

rails 6 rspec error

It’s not released yet, but you can add the pre-release version of the rspec-rails gem to your Gemfile from Github and run bundle install to get your specs working again:

group :development, :test do
  gem 'rspec-rails', 
    git: 'https://github.com/rspec/rspec-rails.git', 
    tag: 'v4.0.0.beta2'