Skip to content

Instantly share code, notes, and snippets.

@mjc-gh
Created March 15, 2012 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjc-gh/2045602 to your computer and use it in GitHub Desktop.
Save mjc-gh/2045602 to your computer and use it in GitHub Desktop.
test application controller method
class ApplicationControllerTest < ActionController::TestCase
def setup
# create and initialize anonymous controller
@controller = Class.new(ApplicationController) do
def index
# what goes here all depends on the situation and the method your trying to test
end
end::new
end
test "my test" do
get :index
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment