Merge pull request #1698 from internetee/add-tara-to-registrant

Expand TARA auth logic to registrant portal
This commit is contained in:
Timo Võhmar 2020-10-15 16:58:12 +03:00 committed by GitHub
commit 7f81883e7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 158 additions and 401 deletions

View file

@ -1,31 +0,0 @@
require 'test_helper'
class RegistrantAreaIdCardSignInTest < ApplicationIntegrationTest
setup do
allow_business_registry_component_reach_server
end
def test_succeeds
post registrant_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => 'DOE,JOHN,1234',
'SSL_CLIENT_I_DN_C' => 'US' }
follow_redirect!
assert_response :ok
assert_equal registrant_root_path, path
assert_not_nil controller.current_registrant_user
end
def test_fails_when_certificate_is_absent
post registrant_id_card_sign_in_path, headers: { 'SSL_CLIENT_S_DN_CN' => '' }
assert_response :ok
assert_equal registrant_id_card_sign_in_path, path
assert_nil controller.current_registrant_user
end
private
def allow_business_registry_component_reach_server
WebMock.allow_net_connect!
end
end