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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -