[rspec-users] how can I get prettier failure messages for integration specs?

Patrick J. Collins patrick at collinatorstudios.com
Thu Apr 19 00:01:32 UTC 2012


When an integration test fails, I get a whole mess of garbage that is
all in red, very painful to the eyes--  Especially when I quickly just
want to see what went wrong-- in this case, all I want to see is
ActiveRecord::RecondNotFound-- but instead I see: 
 
Failure/Error: page.should have_content "Submit Payment"
       expected there to be content "Submit Payment" in "Action
Controller: Exception caught\n    body { background-color: #fff; color:
#333; }\n\n    body, p, ol, ul, td {\n      font-family: helvetica,
verdana, arial, sans-serif;\n      font-size:   13px;\n
line-height: 18px;\n    }\n\n    pre {\n      background-color: #eee;\n
padding: 10px;\n      font-size: 11px;\n      white-space: pre-wrap;\n
}\n\n    a { color: #000; }\n    a:visited { color: #666; }\n    a:hover
{ color: #fff; background-color:#000; }\n  \n\n\n
ActiveRecord::RecordNotFound\n   ... bla bla bla bla bla bla forever.

......  Are there any options to reformat this output?  A small
improvement would be to actually turn \n into actual new lines...
However, an even better option would be to make this automatically
launch the browser so that the error page could be read properly.

Is this possible?


Patrick J. Collins
http://collinatorstudios.com



More information about the rspec-users mailing list