lib/spec_helpers/matchers/route_matchers.rb in websocket-rails-0.3.0 vs lib/spec_helpers/matchers/route_matchers.rb in websocket-rails-0.4.0
- old
+ new
@@ -7,11 +7,12 @@
raise ArgumentError, 'event must be of type SpecHelperEvent' unless event.is_a? WebsocketRails::SpecHelperEvent
target_class, target_method = WebsocketRails::TargetValidator.validate_target target
result = false
no_of_routes = 0
- event.dispatcher.event_map.routes_for event do |controller, method|
+ event.dispatcher.event_map.routes_for event do |controller_class, method|
no_of_routes += 1
+ controller = controller_class.new
if controller.class == target_class and method == target_method
result = true
end
end
result and (non_exclusive or no_of_routes == 1)