Sha256: c34e15843a1e618933c2ccafd60fb81cdc6b3a90a4575db17525a07ce82662b5

Contents?: true

Size: 1.25 KB

Versions: 63

Compression:

Stored size: 1.25 KB

Contents

ENV["RAILS_ENV"] ||= 'test'

require File.expand_path("../dummy/config/environment", __FILE__)

require 'rspec/rails'
require 'rspec/autorun'
require 'capybara/rspec'
require 'capybara/poltergeist'
require 'factory_girl_rails'
require 'haml'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f }

RSpec.configure do |config|
  config.fixture_path = "#{::Rails.root}/spec/fixtures"

  config.include Capybara::DSL

  Capybara.current_driver = :poltergeist
  Capybara.javascript_driver = :poltergeist
  Capybara.default_wait_time = 5

  Rails.logger.level = 4    # Output only minimal stuff to test.log

  config.use_transactional_fixtures = true   # Make this false to once again use DatabaseCleaner
  config.infer_base_class_for_anonymous_controllers = false
  config.order = 'random'
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

63 entries across 63 versions & 2 rubygems

Version Path
effective_pages-1.3.2 spec/spec_helper.rb
effective_pages-1.3.1 spec/spec_helper.rb
effective_pages-1.3.0 spec/spec_helper.rb
effective_pages-1.2.0 spec/spec_helper.rb
effective_pages-1.1.9 spec/spec_helper.rb
effective_pages-1.1.8 spec/spec_helper.rb
effective_pages-1.1.7 spec/spec_helper.rb
effective_pages-1.1.6 spec/spec_helper.rb
effective_pages-1.1.5 spec/spec_helper.rb
effective_pages-1.1.4 spec/spec_helper.rb
effective_pages-1.1.3 spec/spec_helper.rb
effective_pages-1.1.2 spec/spec_helper.rb
effective_pages-1.1.1 spec/spec_helper.rb
effective_pages-1.1.0 spec/spec_helper.rb
effective_pages-1.0.17 spec/spec_helper.rb
effective_pages-1.0.16 spec/spec_helper.rb
effective_pages-1.0.15 spec/spec_helper.rb
effective_posts-0.4.7 spec/spec_helper.rb
effective_pages-1.0.14 spec/spec_helper.rb
effective_pages-1.0.13 spec/spec_helper.rb