Sha256: 92841aeee56f2ccb0f54043d8b320c6c64edcd75fe78bb3a36c3681450a3f86a
Contents?: true
Size: 1.35 KB
Versions: 15
Compression:
Stored size: 1.35 KB
Contents
require 'action_controller/railtie' # We define our single Rails application here, one time, upon the first inclusion # Tests should feel free to define their own Controllers locally, but if they # need anything special at the Application level, put it here if !defined?(MyApp) ENV['NEW_RELIC_DISPATCHER'] = 'test' class MyApp < Rails::Application # We need a secret token for session, cookies, etc. config.active_support.deprecation = :log config.secret_token = "49837489qkuweoiuoqwehisuakshdjksadhaisdy78o34y138974xyqp9rmye8yrpiokeuioqwzyoiuxftoyqiuxrhm3iou1hrzmjk" end MyApp.initialize! MyApp.routes.draw do get('/bad_route' => 'Test#controller_error', :constraints => lambda do |_| raise ActionController::RoutingError.new('this is an uncaught routing error') end) match '/:controller(/:action(/:id))' end class ApplicationController < ActionController::Base; end # a basic active model compliant model we can render class Foo extend ActiveModel::Naming def to_model self end def valid?() true end def new_record?() true end def destroyed?() true end def raise_error raise 'this is an uncaught model error' end def errors obj = Object.new def obj.[](key) [] end def obj.full_messages() [] end obj end end end
Version data entries
15 entries across 15 versions & 3 rubygems