ruby on rails - Using mocha for controller in functional test with RSPEC -


I am using some examinations, and I have to assure that the controller is calling the log method in some actions . I am also using MOCHA.

I want something like this:

  Tag "it should redirect the update action when the model is active". Any_instance.stubs (: valid?). Returns (true): Update ,: ID = & gt; Tag First Controller Exchange (. Add_team_log) .at_least_once response.should redirect_to (edit_admin_tag_url (specifies [: tag]))   

is there anything to use as 'controller' variable? I tried myself, the name of the controller class ...

I have helped with it test controllers For this, you will tell your glasses in the name of the controller whose name is (also should be in the Controllers folder)

  Describe the articles What controllers show the understated_view "GET index" ... update "when the model is valid then the action redirects Rana should "... the controller .expects (: add_team_log) .at_least_once ... and end   

end

Comments