ruby on rails - How to Test Controller Private Method -
this private method of controller
def query_url(query) client_queries_path(@client, query) end
and index.json.jbuilder file use method
json.array!(@queries) |query| json.extract! query, :id, :url, :keywords, :exclusions json.url query_url(query, format: :json) end
i want write test cases - how can write ?
thanks in advance
if using rspec can call private method controller.send
. in case:
controller.send(:query_url, "whatever query want test")
Comments
Post a Comment