Sha256: 5f9f57f41da3a877563214d9b5095d5f57ff4d1cbbedabed2110d22b1fc45297

Contents?: true

Size: 1.37 KB

Versions: 6

Compression:

Stored size: 1.37 KB

Contents

ENV["RAILS_ENV"] ||= 'test'
ENV["NYAUTH_ENCRYPTION_SECRET"] = '1d5deeac604397c58c8ecdfecf1116e1c019a7355f612e67d8d40ac8fbf36b13de1e78dfffeecdf720aa953ab66d23718e21aee4cac5aa7939f34b89d5e6236b'
require 'spec_helper'
require File.expand_path("../dummy/config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/email/rspec'
require 'nyauth/test/macros'

Rails.application.config do
  config.middleware.use RackSessionAccess::Middleware
end

ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
Dir[File.join(ENGINE_RAILS_ROOT, "spec/support/**/*.rb")].each {|f| require f }
FactoryGirl.definition_file_paths << File.join(ENGINE_RAILS_ROOT, "spec/factories")

ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)

RSpec.configure do |config|
  config.use_transactional_fixtures = false
  config.infer_spec_type_from_file_location!

  config.include FactoryGirl::Syntax::Methods
  config.include Nyauth::Test::ControllerMacros, type: :controller
  config.include Nyauth::Test::FeatureMacros, type: :feature
  config.include EmailSpec::Helpers, type: :mailer
  config.include EmailSpec::Matchers, type: :mailer

  config.before(:suite) do
    DatabaseRewinder.clean
    Rails.cache.clear
  end

  config.before(:all) do
    FactoryGirl.reload
  end

  config.after :each do
    DatabaseRewinder.clean
    Rails.cache.clear
  end

  Faker::Config.locale = :en
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nyauth-0.6.2 spec/rails_helper.rb
nyauth-0.6.1 spec/rails_helper.rb
nyauth-0.6.0 spec/rails_helper.rb
nyauth-0.5.0 spec/rails_helper.rb
nyauth-0.4.0 spec/rails_helper.rb
nyauth-0.3.0 spec/rails_helper.rb