Sha256: f85fd243f573ca492b36025c4e7f4960409c7e58df9f31a0519522af85b8149e

Contents?: true

Size: 1.4 KB

Versions: 7

Compression:

Stored size: 1.4 KB

Contents

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

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

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'scidea-schools'

require 'rspec/rails'
require 'rspec_tag_matchers'
require 'cancan/matchers'
require 'paperclip/matchers'

require File.expand_path("../../features/support/seed_user_roles.rb", __FILE__)

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

RSpec.configure do |config|
  config.mock_with :rspec
  config.use_transactional_fixtures = true

  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
    ::SeedUserRoles.seed
  end

  config.before(:each) do
    DatabaseCleaner.start
  end

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

  config.after(:suite) do
    ::SeedUserRoles.clean
  end

  config.include Devise::TestHelpers, :type => :controller
  config.include Devise::TestHelpers, :type => :view
  config.extend ControllerMacros, :type => :controller
end

# load local factories which will be added to the factories from scidea.
Rails.configuration.after_initialize do
  FactoryGirl.definition_file_paths = [File.expand_path('../factories', __FILE__)]
  FactoryGirl.find_definitions
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
scidea-schools-1.1 spec/spec_helper.rb
scidea-schools-1.0.6 spec/spec_helper.rb
scidea-schools-1.0.5 spec/spec_helper.rb
scidea-schools-1.0.4 spec/spec_helper.rb
scidea-schools-1.0.3 spec/spec_helper.rb
scidea-schools-1.0.2 spec/spec_helper.rb
scidea-schools-1.0.1 spec/spec_helper.rb