From 78e3a488291fcc28e8293a25f3d5f1e95741d362 Mon Sep 17 00:00:00 2001 From: Kim Burgestrand Date: Tue, 26 Mar 2013 13:24:49 +0100 Subject: [PATCH] Make sure we are comparing gem versions, closes #1024 Due to rails/rails#8501, we can no longer case the Rails version to a float. This version should hopefully work on both Rails 4 master and on Rails 3. --- lib/capybara/rails.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/capybara/rails.rb b/lib/capybara/rails.rb index 03ecd60e..e9f4cd5c 100644 --- a/lib/capybara/rails.rb +++ b/lib/capybara/rails.rb @@ -3,7 +3,7 @@ require 'capybara/dsl' Capybara.app = Rack::Builder.new do map "/" do - if Rails.version.to_f >= 3.0 + if Gem::Version.new(Rails.version) >= Gem::Version.new("3.0") run Rails.application else # Rails 2 use Rails::Rack::Static