Sha256: 3175f80c65e4fbbfc46f23faf06fd7be7f7f6364baadd63dcf23b8e733c157f8

Contents?: true

Size: 1.2 KB

Versions: 17

Compression:

Stored size: 1.2 KB

Contents

# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../../config/environment", __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require "spec_helper"
require "rspec/rails"
require "rspec/its"

Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }

# Checks for pending migration and applies them before tests are run.
# If you are not using ActiveRecord, you can remove this line.
ActiveRecord::Migration.maintain_test_schema!

RSpec.configure do |config|
  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
  config.fixture_path = "#{::Rails.root}/spec/fixtures"

  config.use_transactional_fixtures = true

  config.infer_spec_type_from_file_location!
  config.filter_rails_from_backtrace!
  config.before(:each) do
    Sapience.reset!
  end

  config.before(:suite) do
    FileUtils.cp(
      Rails.root.join("spec/fixtures/sapience.yml"),
      Rails.root.join("config/sapience.yml"),
    )
  end

  config.after(:suite) do
    FileUtils.rm(Rails.root.join("config/sapience.yml"))
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
sapience-0.2.4 test_app/spec/rails_helper.rb
sapience-0.2.3 test_app/spec/rails_helper.rb
sapience-0.2.2 test_app/spec/rails_helper.rb
sapience-0.2.1 test_app/spec/rails_helper.rb
sapience-0.2.0 test_app/spec/rails_helper.rb
sapience-0.1.13 test_app/spec/rails_helper.rb
sapience-0.1.12 test_app/spec/rails_helper.rb
sapience-0.1.11 test_app/spec/rails_helper.rb
sapience-0.1.10 test_app/spec/rails_helper.rb
sapience-0.1.9 test_app/spec/rails_helper.rb
sapience-0.1.8 test_app/spec/rails_helper.rb
sapience-0.1.7 test_app/spec/rails_helper.rb
sapience-0.1.6 test_app/spec/rails_helper.rb
sapience-0.1.5 test_app/spec/rails_helper.rb
sapience-0.1.4 test_app/spec/rails_helper.rb
sapience-0.1.3 test_app/spec/rails_helper.rb
sapience-0.1.2 test_app/spec/rails_helper.rb