Sha256: c8e5aaf72d70149dc05959875197dfcc5f2e4232d06f346de89e63a55092bd54

Contents?: true

Size: 1.34 KB

Versions: 5

Compression:

Stored size: 1.34 KB

Contents

# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require 'spec_helper'
require File.expand_path('../dummy/config/environment', __FILE__)
require 'rspec/rails'
require 'factory_girl_rails'
require 'database_cleaner'
require 'shoulda-matchers'
require 'faker'
ActiveRecord::Migration.maintain_test_schema!

# Adding support files
# Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
Dir[Exposition::Engine.root.join("spec/support/**/*.rb")].each { |f| require f }

RSpec.configure do |config|
  config.use_transactional_fixtures = true
  config.infer_spec_type_from_file_location!
  config.include FactoryGirl::Syntax::Methods
  config.use_transactional_fixtures = false

  config.expect_with :rspec do |expectations|
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  end

  config.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
  end

  config.before(:suite) do
    DatabaseCleaner.clean_with(:truncation)
  end

  config.before(:each) do |example|
    DatabaseCleaner.strategy= example.metadata[:js] ? :truncation : :transaction
    DatabaseCleaner.start
  end

  config.after(:each) do
    DatabaseCleaner.clean
  end

  # Delete test files from paperclip
  config.after(:suite) do
    FileUtils.rm_rf(Dir["#{Rails.root}/spec/test_files/"])
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
exposition-0.0.5.2.pre.alpha spec/rails_helper.rb
exposition-0.0.5.1.pre.alpha spec/rails_helper.rb
exposition-0.0.5.pre.alpha spec/rails_helper.rb
exposition-0.0.4.pre.alpha spec/rails_helper.rb
exposition-0.0.3.pre.alpha spec/rails_helper.rb