Skip to content

Instantly share code, notes, and snippets.

@iosadchiy
Created May 12, 2011 13:45
Show Gist options
  • Save iosadchiy/968518 to your computer and use it in GitHub Desktop.
Save iosadchiy/968518 to your computer and use it in GitHub Desktop.
# spec/support/auth_helper.rb
module AuthHelper
def admin_login
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('username', 'password')
end
end
# spec/controllers/admin/smt_controller_spec.rb
describe SmtController do
before { admin_login }
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment