blowmage / minitest-rails-capybara

Capybara integration for MiniTest::Rails
http://blowmage.com/minitest-rails-capybara
MIT License
131 stars 40 forks source link

Minitest with Rails 5.2.0 - Uninitialized constant Minitest::Rails::TestUnit (NameError) #44

Open tomrossi7 opened 6 years ago

tomrossi7 commented 6 years ago

While using Ruby 2.3.3 and upgrading the Rails gem from 5.1.4 to 5.2.0.beta2, rake fails:

$ rake
.../gems/railties-5.2.0.beta2/lib/minitest/rails_plugin.rb:16:in `plugin_rails_options': uninitialized constant Minitest::Rails::TestUnit (NameError)
    .../gems/ruby-2.3.3@donortools2/gems/minitest-5.10.3/lib/minitest.rb:201:in `block (2 levels) in process_args'
    .../gems/ruby-2.3.3@donortools2/gems/minitest-5.10.3/lib/minitest.rb:199:in `each'
    .../gems/minitest-5.10.3/lib/minitest.rb:199:in `block in process_args'
    .../.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/optparse.rb:1062:in `initialize'
    .../gems/minitest-5.10.3/lib/minitest.rb:169:in `new'
    .../gems/minitest-5.10.3/lib/minitest.rb:169:in `process_args'
    .../gems/minitest-5.10.3/lib/minitest.rb:123:in `run'
    .../gems/minitest-5.10.3/lib/minitest.rb:63:in `block in autorun'

I've tracked this back to the minitest-rails-capybara gem. Anyone have a fix?

lostapathy commented 6 years ago

Just linking this to the other ticket where this was found - rails/rails#31324

bootleq commented 5 years ago

Found with minitst-rails 5.0, bundler installs minitest-rails-capybara 0.0.2, which causes this error.

With Gemfile 'minitest-rails', '~> 3.0' (lock to ~> 3), minitest-rails-capybara 3.0.1 is installed and does work.

blowmage commented 5 years ago

minitest-rails-capybara support ends with minitest-rails 3.x. If you want to use minitest-rails 5.1+ you should transition to system tests. If you need to stay on Rails 5.0, I would use minitest-rails 3 and minitest-rails-capybara 3 instead of minitest-rails 5.0.

https://blowmage.com/2019/06/18/minitest-rails-releases