Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A gem to add Capybara driver switching parameters to minitest/spec's describe and it.

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.mdown
Octocat-spinner-32 Rakefile
Octocat-spinner-32 minitest-capybara.gemspec


This gem adds to minitest/spec the functionality that allows you to change Capybara drivers by passing parameters to it, similarly to RSpec.


To install, add this to your Gemfile and do a bundle install:

gem "minitest-capybara", "~> 0.0.1"

Then in your minitest/specs (or a spec_helper that they all require) add:

require 'minitest/capybara'

Now you can change the driver to Selenium by passing the parameter `:js => true':

describe "something under test" do
  it "does not use selenium for this test" do
    visit "/"
    assert body.has_content?("Hello world")

  it "does use selenium for this test", :js => true do
    visit "/"
    click_link "Hide" # a link that uses a javascript click event, for example
    assert body.has_no_link?("Hide")

Future improvements

  • Support :js => true on describe as well
  • Support drivers other than rack_test and selenium (currently the driver will be switched back to rack_test when an example is finished, and setting Capybara.javascript_driver has no effect)
  • Support a :driver parameter to switch to a specific driver


Many thanks to those who have worked on RSpec, Capybara and minitest for making such awesome tools.


Released under the MIT license. See LICENSE.

Something went wrong with that request. Please try again.