Sha256: 5aa03a92b133a9633703628c22fcaea20ce57ada4b9440a813a6415c39c98271

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 KB

Contents

# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# Require this file using `require "spec_helper.rb"` to ensure that it is only
# loaded once.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration

ENV["RAILS_ENV"] = 'test'
require_relative "dummy/config/environment"

require 'rspec/rails'
require 'assert_difference'
require 'sqlite3'

require 'haml'

# Add this to load Capybara integration:
require 'capybara/rspec'
require 'capybara/rails'

Capybara.default_selector  = :css

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.run_all_when_everything_filtered = true
  config.include AssertDifference
  config.use_transactional_fixtures = true
  config.include Capybara::DSL
  config.infer_spec_type_from_file_location!
end


class ActiveRecord::Base
  mattr_accessor :shared_connection
  @@shared_connection = nil

  def self.connection
    @@shared_connection || retrieve_connection
  end
end

# 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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nested_form_fields-0.8 spec/spec_helper.rb
nested_form_fields-0.7.8 spec/spec_helper.rb
nested_form_fields-0.7.7 spec/spec_helper.rb
nested_form_fields-0.7.6 spec/spec_helper.rb