From 2ba82022c6f7d509d2b3a5972615340db5a8097a Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Fri, 13 Jul 2012 11:19:38 +0100 Subject: Misc fixes to get tests to pass - notably a MonkeyPatch to work around problem testing template results --- spec/spec_helper.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'spec/spec_helper.rb') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a7f3020c1..c11c7c5bc 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -206,3 +206,16 @@ def load_test_categories "Miscellaneous", [ "other", "Miscellaneous", "miscellaneous" ],]) end + + +# Monkeypatch applicationcontroller because the `render_to_string` +# method in the original breaks all the rspec test assertions such as +# `should render_template('foo')`. Same problem as +# http://stackoverflow.com/questions/8174415/is-it-possible-to-assert-template-or-render-template-against-the-same-partial-wi +# - a bug in either Rails or Rspec I don't have the time to fix :( + +class ApplicationController < ActionController::Base + def set_popup_banner + @popup_banner = nil + end +end -- cgit v1.2.3