From 20adfb53693879a4b5c29b752fc06a130df18d42 Mon Sep 17 00:00:00 2001 From: Jan Provaznik Date: Sat, 16 Jun 2018 21:20:58 +0200 Subject: Fix nil formats test One of the spec files sets `nil` value for env varialbe `action_dispatch.request.formats`. Rather than setting `nil` value, we can delete the `action_dispatch.request.formats` key from `env` (which should be closer to real use case anyway). The reason is that in Rails 5, `formats` method does not set default array of formats if the env key is already set (even if set to `nil`). --- spec/lib/gitlab/auth/user_auth_finders_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/lib/gitlab/auth/user_auth_finders_spec.rb b/spec/lib/gitlab/auth/user_auth_finders_spec.rb index 136646bd4ee..454ad1589b9 100644 --- a/spec/lib/gitlab/auth/user_auth_finders_spec.rb +++ b/spec/lib/gitlab/auth/user_auth_finders_spec.rb @@ -99,7 +99,7 @@ describe Gitlab::Auth::UserAuthFinders do context 'when the request format is empty' do it 'the method call does not modify the original value' do - env['action_dispatch.request.formats'] = nil + env.delete('action_dispatch.request.formats') find_user_from_feed_token -- cgit v1.2.1