Created
March 15, 2012 17:50
-
-
Save mjc-gh/2045602 to your computer and use it in GitHub Desktop.
test application controller method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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