Forum: RSpec Rails HTML error page in the console.

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
67d39b1d4d6f73d49eca143e51ea254e?d=identicon&s=25 Matt Wynne (Guest)
on 2009-05-13 10:33
(Received via mailing list)
I'm still bugged by the fact that when I get an exception during a
feature run (e.g. Couldn't find partial) then what I see in the
console is all the HTML to report that error in a browser.

I have had a few ideas for this bubbling around at the back of my
mind. I wondered whether anyone else was thinking about this too.

I guess the idea would be to patch rails's
ActionController#rescue_action_locally with something that threw the
exception out at Cucumber rather than bubbling it up to the web. What
do you think? Would it work? What are the drawbacks I haven't thought
of?

cheers,
Matt Wynne
http://beta.songkick.com
http://blog.mattwynne.net
146e52d49d361f85c0945487452fc6a0?d=identicon&s=25 Ben Lovell (benl)
on 2009-05-13 12:45
(Received via mailing list)
On Wed, May 13, 2009 at 8:42 AM, Matt Wynne
<matt.songkick@googlemail.com>wrote:

> think? Would it work? What are the drawbacks I haven't thought of?
>
> cheers,
> Matt Wynne
> http://beta.songkick.com
> http://blog.mattwynne.net


This is definitely something that irks me regularly too. If the HTML
displayed were more focused to the actual section that was under
inspection
that would be hella nice. Although, I realise this would be pretty
difficult
to achieve. That said, there certainly are times when you _need_ to see
the
whole HTML.

Ben L
C694a032be7518a0d704318895f8fe1d?d=identicon&s=25 Ben Mabey (mabes)
on 2009-05-13 17:37
(Received via mailing list)
Matt Wynne wrote:
> do you think? Would it work? What are the drawbacks I haven't thought of?
>
> cheers,
> Matt Wynne
> http://beta.songkick.com
> http://blog.mattwynne.net


Have you tried catching the error in an After block and opening up the
page?  Aslak added that functionality:

https://rspec.lighthouseapp.com/projects/16211/tic...

-Ben
Cdf378de2284d8acf137122e541caa28?d=identicon&s=25 Matt Wynne (mattwynne)
on 2009-05-17 19:20
(Received via mailing list)
On 13 May 2009, at 11:40, Ben Lovell wrote:

> On Wed, May 13, 2009 at 8:42 AM, Matt Wynne <matt.songkick@googlemail.com
> > wrote:
> This is definitely something that irks me regularly too. If the HTML
> displayed were more focused to the actual section that was under
> inspection that would be hella nice. Although, I realise this would
> be pretty difficult to achieve. That said, there certainly are times
> when you _need_ to see the whole HTML.
>
> Ben L

I think we're talking about different things actually. Do you know
about the #within method in webrat?

Matt Wynne
http://blog.mattwynne.net
http://www.songkick.com
Cdf378de2284d8acf137122e541caa28?d=identicon&s=25 Matt Wynne (mattwynne)
on 2009-05-17 19:23
(Received via mailing list)
On 13 May 2009, at 16:13, Ben Mabey wrote:

>> the exception out at Cucumber rather than bubbling it up to the
> the page?  Aslak added that functionality:
>
> https://rspec.lighthouseapp.com/projects/16211/tic...
>
> -Ben

I think I've actually realised this must be happening because we're
using an old version of webrat - I've just set up a fresh rails app
with shiny new cucumber and webrat version and it reports just the
exception backtrace in the console, rather than the whole HTML error
page.

That hook is handy though, thanks for the tip Ben.

Matt Wynne
http://blog.mattwynne.net
http://www.songkick.com
This topic is locked and can not be replied to.