August 25th, 2009
RSpec and Rails Helpers using the output buffer
When testing helper methods that use rails’ output buffer (for example by calling concat) with RSpec, be sure to add this to your specs: 1 before(:each) do 2 helper.output_buffer = "" 3 end Took me a while to figure this one out. Apparently RSpec doesn’t initialize the output buffer and...