Topic: How to stub and return module in functionaltetsing
Hi friends,
I need to mock/stub resultset = Search::Dataload.check_data_users({:a => 'ds',:d => '22'}) in below code.I need to stop execute this method while running testcases for this controller.i need to stub that line of code and return expected result set withouth executing that
resultset is type of HASH
class MyDatacontroller < Authcontroller
def check_data
resultset = Search::Dataload.check_data_users({:a => 'ds',:d => '22'})
end
end
In lib search.rb
module Search
class Dataload
def self.check_data_users(options)
..............
........................
end
end
end