Hi folks. I'm currently using rspec-2.4.0 and rspec-rails-2.4.1.
In the controller I have the code like this (at least at two different
places):
def some_action
raise Exception if some_falsy_value
rescue
@message = 'Error'
end
but when I do testing with rspec this exception doesn't proceeded by
controller, and I'm getting the following:
1) SignupsController GET confirm_email should proceed unexpected errors
Failure/Error: get :confirm_email, @params
Exception:
Exception
# ./app/controllers/signups_controller.rb:251:in `confirm_email'
# ./spec/controllers/signups_controller_spec.rb:168:in `block (3
levels) in <top (required)>'
I saw in examples that we can do exceptions catching by contoller filters
like (rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found)
but I don't want to use this way, con my exceptions aren't controller wide,
they only related to some single action.
Also, it's my first email to mailing group, if I composed it incorrectly,
someone please let me know.
Yuriy
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users