Capybara integration for MiniTest::Rails.
gem install minitest-rails-capybara
This installs the following gems:
minitest minitest-rails capybara
Follow the instructions to configure minitest-rails. Then add minitest-rails-capybara to the :test and :development groups in Gemfile:
group :test, :development do gem 'minitest-rails' gem 'minitest-rails-capybara' end
Add the following to your minitest_helper.rb file to the test directory.
Generate a new acceptance test using the default generator:
rails generate integration_test CanAccessHome
And you can specify use of the MiniTest::Spec DSL by providing the --spec option:
rails generate integration_test CanAccessHome --spec
You can now use Capybara in your acceptance tests!
require "minitest_helper" class CanAccessHomeTest < MiniTest::Rails::ActionDispatch::IntegrationTest test "the homepage has content" do visit root_path assert page.has_content?("Home#index") end end
Join the mailing list to get help or offer suggestions.
Copyright © 2012 Mike Moore.
Released under the MIT license. See `LICENSE` for details.