Topic: testing controller modules


   I have a controller that defines a module and I'm wondering how I can write a functional test for methods w/in the module.

Here's the basic structure of the controller module blog_controller:

require 'hmac/hmac-sha2'

module BlogController
  PAGEXI_HMAC_SHA256_KEY = "sdfqaasdfwfa3rq32aq"

  def combined
    render :partial => "/blog/page_object_combined"

Any ideas?


Re: testing controller modules

Rather than trying to test the methods directly just test the behavior of your controllers that have included the module.  Your tests should specify the ideal behavior of your application.  This means that you should be able to alter the BlogController without your tests failing - as long as the application still does what it's supposed to.