Permalink
Browse files

add support for controller helper methods in view specs

  • Loading branch information...
dchelimsky committed Apr 17, 2010
1 parent 08e371b commit 12ae990d8e20ac476c59cdd407d115e9bc305052
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/rspec/rails/example/view_example_group.rb
@@ -10,11 +10,11 @@ class ViewExampleController < ActionController::Base
module ViewExtension
def protect_against_forgery?; end
def method_missing(selector, *args)
if Rails.application.routes.named_routes.helpers.include?(selector)
controller.__send__(selector, *args)
def method_missing(name, *args)
if controller.respond_to?(name) || Rails.application.routes.named_routes.helpers.include?(name)
controller.__send__(name, *args)
else
super
super(name, *args)
end
end
end

0 comments on commit 12ae990

Please sign in to comment.