jnicklas/capybara — Issue #518: Requiring capybara/rails gives a uninitialized constant Object::Rack
Author: usharf
Created: 2011-10-09 14:02:56+00:00
State: open

In Rails 3.1, when I add capybara/rails test fail with

```bash
vendor/ruby/1.9.1/gems/capybara-1.1.0/lib/capybara/rails.rb:4:in `': uninitialized constant Object::Rack (NameError)
```

my test_helper.rb

``` ruby

require "minitest/autorun"
require "minitest/spec"
require "minitest/rails"
require "capybara/rails"

ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)

class MiniTest::Rails::Spec
include Rails.application.routes.url_helpers
end

# Uncomment to support fixtures in Model tests...
# require "active_record/fixtures"
class MiniTest::Rails::Model
# include ActiveRecord::TestFixtures
# self.fixture_path = File.join(Rails.root, "test", "fixtures")
end
```

Gemfile

```ruby
group :test, :development do
gem 'minitest-rails'
end

group :test do
gem 'capybara'
gem 'factory_girl_rails'
gem 'rb-fsevent'
gem 'guard-minitest'
end
```