Skip to content

Instantly share code, notes, and snippets.

@deepak
Created September 9, 2012 04:55
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 deepak/3682659 to your computer and use it in GitHub Desktop.
Save deepak/3682659 to your computer and use it in GitHub Desktop.
test for force_ssl
class ForceSSLWithExtraOptions < ForceSSLController
force_ssl :only => :cheeseburger, :port => 4000, :status => :temporary_redirect
end
class ForceSSLWithExtraOptionsTest < ActionController::TestCase
tests ForceSSLWithExtraOptions
def test_cheeseburger_redirects_and_calls_force_ssl_redirect
@controller.expects(:force_ssl_redirect).with(nil, {port: 4000, status: :temporary_redirect})
get :cheeseburger
end
end
@deepak
Copy link
Author

deepak commented Sep 9, 2012

the other tests break. should i create another test file ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment