Skip to content

Commit

Permalink
Merge pull request #256 from JonRowe/dumb_fix_for_rails4_test_help
Browse files Browse the repository at this point in the history
(dumb) Fix for Rails4
  • Loading branch information
Kosmas committed Aug 13, 2013
2 parents 0bfe70b + 94241cc commit 4ee036d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cucumber-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency('cucumber', '>= 1.2.0')
s.add_runtime_dependency('nokogiri', '>= 1.5.0')
s.add_runtime_dependency('capybara', '>= 1.1.2')
s.add_runtime_dependency('rails', '~> 3.0')
s.add_runtime_dependency('rails', '>= 3.0')

# Main development dependencies
s.add_development_dependency('rake', '>= 0.9.2.2')
Expand Down
14 changes: 12 additions & 2 deletions lib/cucumber/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
require File.expand_path(ENV["RAILS_ROOT"] + '/config/environment')
require 'cucumber/rails/action_controller'

require 'action_dispatch/testing/integration'

if defined?(ActiveRecord::Base)
require 'rails/test_help'
class ActiveSupport::TestCase
include ActiveRecord::TestFixtures
self.fixture_path = "#{Rails.root}/test/fixtures/"
end

ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path

def create_fixtures(*fixture_set_names, &block)
FixtureSet.create_fixtures(ActiveSupport::TestCase.fixture_path, fixture_set_names, {}, &block)
end
else
require 'action_dispatch/testing/test_process'
require 'action_dispatch/testing/integration'
end

if !Rails.application.config.cache_classes
Expand Down

0 comments on commit 4ee036d

Please sign in to comment.