I have a controller action that raises a RecordNotFound exception if
you’re not allowed to see something. In my global application
controller (application.rb), I catch these and render the 404
template. But when I run cucumber (using webrat), it’s getting the
full stacktrace (the step blows up). Any ideas why? I have
consider_all_requests_local turned off in my test.rb.
I have a controller action that raises a RecordNotFound exception if
you’re not allowed to see something. In my global application
controller (application.rb), I catch these and render the 404
template. But when I run cucumber (using webrat), it’s getting the
full stacktrace (the step blows up). Any ideas why? I have
It’s because Cucumber’s Rails support configures ActionController to
send all errors straight through.
See cucumber/rails/world.rb
Patches and suggestions about how to improve this are welcome.
(In most cases it’s easier to spot errors when exceptions ripple
through)
On Mon, Feb 9, 2009 at 6:11 AM, aslak hellesoy [email protected] wrote:
It’s because Cucumber’s Rails support configures ActionController to
send all errors straight through.
See cucumber/rails/world.rb
Patches and suggestions about how to improve this are welcome.
(In most cases it’s easier to spot errors when exceptions ripple through)
Make it a configuration option? Or catch it with a proxy that
inspects the exception then passes it back to Rails, and provide
matchers or formatting options that display Cucumber’s analysis only
when the user wants it?
I’m with Jeff on this: RecordNotFound isn’t necessarily an “error,”
it’s just an exception. One that will frequently come up in normal
user interaction. A well-behaved app will do appropriate things with
that exception and Cucumber should be able to test for those
appropriate things. A testing framework that disrupts the application
behavior cannot test it.
On Mon, Feb 9, 2009 at 10:21 AM, aslak hellesoy [email protected] wrote:
Make it a configuration option? Or catch it with a proxy that
Good points. Please create a Lighthouse ticket for this. I’m looking
forward to concrete suggestions about how to make this configurable
and patches I can pull in
Good points. Please create a Lighthouse ticket for this. I’m looking
forward to concrete suggestions about how to make this configurable
and patches I can pull in
Aslak
Instead of creating a new ticket we should probably continue the
discussion on this ticket:
inspects the exception then passes it back to Rails, and provide
matchers or formatting options that display Cucumber’s analysis only
when the user wants it?
I’m with Jeff on this: RecordNotFound isn’t necessarily an “error,”
it’s just an exception. One that will frequently come up in normal
user interaction. A well-behaved app will do appropriate things with
that exception and Cucumber should be able to test for those
appropriate things. A testing framework that disrupts the application
behavior cannot test it.
Good points. Please create a Lighthouse ticket for this. I’m looking
forward to concrete suggestions about how to make this configurable
and patches I can pull in
Aslak
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.