re-raise exceptions in stories?

View: New views
2 Messages — Rating Filter:   Alert me  

re-raise exceptions in stories?

by Neil M. Young :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I see that rails handles exceptions in stories by rendering public/500.html, whereas in controller specs exceptions are re-raised. Is it possible to have this same behaviour in stories so I can check the correct exceptions are being raised?

Re: re -raise exceptions in stories?

by Ben Mabey-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Neil M. Young wrote:
> I see that rails handles exceptions in stories by rendering public/500.html,
> whereas in controller specs exceptions are re-raised. Is it possible to have
> this same behaviour in stories so I can check the correct exceptions are
> being raised?
>  
I do this by putting the following in my helper.rb:

ActionController::Base.class_eval do
  def perform_action
    perform_action_without_rescue
  end
end

Dispatcher.class_eval do
  def self.failsafe_response(output, status, exception = nil)
    raise exception
  end
end
_______________________________________________
rspec-users mailing list
rspec-users@...
http://rubyforge.org/mailman/listinfo/rspec-users