diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-11-16 11:57:19 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-11-16 11:57:19 +0100 |
commit | 628491f039f77dcd3f71dc913477bf61bddb5d83 (patch) | |
tree | 774b752a59314c61de93560421472f35c56d6d73 | |
parent | df7e00b786c3b9dcfd840e5569ee78c53b72435d (diff) | |
download | gitlab-ce-bvl-adjust-openid_connect_spec.tar.gz |
Adjust openid_connect_spec to use `raise_error`bvl-adjust-openid_connect_spec
Using the `raise_error`-matcher instead of `throw_symbol` makes sure
our after blocks get called in the test suite.
-rw-r--r-- | spec/requests/openid_connect_spec.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/requests/openid_connect_spec.rb b/spec/requests/openid_connect_spec.rb index 0b1f8ce6f6d..7d501de83f8 100644 --- a/spec/requests/openid_connect_spec.rb +++ b/spec/requests/openid_connect_spec.rb @@ -107,6 +107,15 @@ describe 'OpenID Connect requests' do end end + # These 2 calls shouldn't actually throw, they should be handled as an + # unauthorized request, so we should be able to check the response. + # + # This was not possible due to an issue with Warden: + # <Link to patch> + # + # When the patch gets merged and we update Warden, these specs will need to + # updated to check the response instead of a raised exception. + # https://gitlab.com/gitlab-org/gitlab-ce/issues/40218 context 'when user is blocked' do it 'returns authentication error' do access_grant @@ -114,7 +123,7 @@ describe 'OpenID Connect requests' do expect do request_access_token - end.to throw_symbol :warden + end.to raise_error UncaughtThrowError end end @@ -125,7 +134,7 @@ describe 'OpenID Connect requests' do expect do request_access_token - end.to throw_symbol :warden + end.to raise_error UncaughtThrowError end end end |