Class: CancanUnitTest::StubFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/cancan_unit_test/stub_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(controller, method) ⇒ StubFinder

Returns a new instance of StubFinder.



4
5
6
# File 'lib/cancan_unit_test/stub_finder.rb', line 4

def initialize(controller, method)
  @stub_list = controller._get_cancan_unit_test_stubs(method)
end

Instance Method Details

#find_by_collection(model, options) ⇒ Object



12
13
14
# File 'lib/cancan_unit_test/stub_finder.rb', line 12

def find_by_collection(model, options)
  find_by_resource_type(model, :collection, options)
end

#find_by_singleton(model, options) ⇒ Object



8
9
10
# File 'lib/cancan_unit_test/stub_finder.rb', line 8

def find_by_singleton(model, options)
  find_by_resource_type(model, :singleton, options)
end