Closed jamezilla closed 12 years ago
Yeah, we shouldn't need that require since its already listed as the gem's dependency. But its a good idea to have it anyway, I'll add it.
What does your minitest_helper.rb
file look like?
Try updating your Gemfile with the following to use the repo instead of the gem and tell me if the latest commits help.
group :development, :test do
gem "minitest-rails"
gem "minitest-rails-capybara", git: "git@github.com:blowmage/minitest-rails-capybara.git"
end
Using the master repo, so far so good.
Here's what my minitest_helper.rb looks like:
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require "minitest/autorun"
require "minitest/rails"
require "minitest/rails/capybara"
#require "minitest/pride"
DatabaseCleaner.strategy = :truncation
class MiniTest::Spec
before :each do
DatabaseCleaner.clean # Truncate the database
Capybara.reset_sessions! # Forget the (simulated) browser state
Capybara.use_default_driver # Revert Capybara.current_driver to Capybara.default_driver
end
end
class MiniTest::Rails::ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
fixtures :all
# Add more helper methods to be used by all tests here...
end
Awesome. Just released a new gem. Thanks!
I'm able to run tests using Guard, but using the
test
rake task fails:Adding
require 'minitest/rails'
tominitest-rails-capybara.rb
solved the problem for me, but I don't know if that's necessarily the correct patch.