Updated

spec/support / authentication.rb

A
17 lines of codes
2 methods
4.0 complexity/method
3 churn
7.93 complexity
0 duplications
require 'authlogic/test_case' RSpec.configure do |config| mod = Module.new do def login_as(user) activate_authlogic AdminUserSession.create(user) end def http_authentication(username, password) request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(username, password) end end config.include(mod, type: :controller) config.include(Authlogic::TestCase, type: :controller) end