Displaying 1 result from an estimated 1 matches for "error_redirect_gracefully".
2007 Dec 04
1
spec''ing shared controller methods
...spec''d and has pending examples.
## application.rb
class ApplicationController < ActionController::Base
...
def find_account
@account = Account.find_by_id( params[:account_id])
# TODO: check account status is suspended, closed, different
flash message?
return( error_redirect_gracefully( "Account not found")) unless
@account
end
...
end
## application_controller_spec.rb
require File.dirname(__FILE__) + ''/../spec_helper''
ActionController::Routing::Routes.draw do |map|
map.connect ''foos/:action'', :controller => '...