Sha256: 4ae8cb2452a8fe21fdca337882c7c38b496ca3b08b42e03d2b6354a8e61d88b6

Contents?: true

Size: 1.33 KB

Versions: 24

Compression:

Stored size: 1.33 KB

Contents

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

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

require 'rspec/rails'
require 'factory_girl_rails'
require 'stripe_mock'
require 'pry'
require 'shoulda-matchers'

# 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 Devise::TestHelpers, :type => :controller
  config.include Shoulda::Matchers::ActiveModel, :type => :model

  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.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


# To set up this gem for testing:
# spec/dummy> ln -s ../../spec spec
#
# spec/dummy> rails generate effective_orders:install
# spec/dummy> rake db:migrate
# spec/dummy> rake db:test:prepare

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
effective_orders-2.1.1 spec/spec_helper.rb
effective_orders-2.1.0 spec/spec_helper.rb
effective_orders-2.0.1 spec/spec_helper.rb
effective_orders-2.0.0 spec/spec_helper.rb