Sha256: 5308b253db82c288bb7e9988e418cf44b3b2a50636f489ca52dceba772ef0305

Contents?: true

Size: 897 Bytes

Versions: 1

Compression:

Stored size: 897 Bytes

Contents

require "rails"

log_dev = Timber::LogDevices::IO.new
Rails.logger = Timber::Logger.new(log_dev)
Rails.logger.level = ::Logger::FATAL

class RailsApp < Rails::Application
  if ::Rails.version =~ /^3\./
    config.secret_token = '1e05af2b349457936a41427e63450937'
  else
    config.secret_key_base = '1e05af2b349457936a41427e63450937'
  end
  config.active_support.deprecation = :stderr
  config.eager_load = false
  config.log_level = :fatal
end

RailsApp.initialize!

module Support
  module Rails
    def dispatch_rails_request(path)
      application = ::Rails.application
      env = application.respond_to?(:env_config) ? application.env_config.clone : application.env_defaults.clone
      env["rack.request.cookie_hash"] = {}.with_indifferent_access
      ::Rack::MockRequest.new(application).get(path, env)
    end
  end
end

RSpec.configure do |config|
  config.include Support::Rails
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
timberio-1.0.0.beta1 spec/support/rails.rb