Sha256: 28b62a306f07cc837b08a14835c71a6da051838ce0c06c6a6724e40498729d3f

Contents?: true

Size: 472 Bytes

Versions: 3

Compression:

Stored size: 472 Bytes

Contents

if defined?(ActiveRecord::Base)
  require 'cucumber/rails3/active_record'

  Before('@javascript') do
    # Forces all threads to share the same connection. This works on
    # Capybara because it starts the web server in a thread.
    ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
  end

  Before('~@javascript') do
    # Do not use a shared connection unless we're in a @javascript scenario
    ActiveRecord::Base.shared_connection = nil
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cucumber-rails-1.0.0 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-0.5.2 lib/cucumber/rails/hooks/active_record.rb
cucumber-rails-0.5.1 lib/cucumber/rails/hooks/active_record.rb