Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/spec/helpers/application_helper/toolbar_builder_spec.rb b/spec/helpers/application_helper/toolbar_builder_spec.rb
index 546ce2b..81ce5f3 100644
--- a/spec/helpers/application_helper/toolbar_builder_spec.rb
+++ b/spec/helpers/application_helper/toolbar_builder_spec.rb
@@ -3,11 +3,14 @@
describe ApplicationHelper do
before do
controller.send(:extend, ApplicationHelper)
- self.class.send(:include, ApplicationHelper)
end
def method_missing(sym, *args)
- b = _toolbar_builder
+ instance_variables.each do |ivar|
+ controller.instance_variable_set ivar, instance_variable_get(ivar)
+ end
+
+ b = controller._toolbar_builder
if b.respond_to?(sym, true)
b.send(sym, *args)
else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment