diff options
Diffstat (limited to 'spec/support/helpers/session_helpers.rb')
| -rw-r--r-- | spec/support/helpers/session_helpers.rb | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/spec/support/helpers/session_helpers.rb b/spec/support/helpers/session_helpers.rb index 394a401afca..236585296e5 100644 --- a/spec/support/helpers/session_helpers.rb +++ b/spec/support/helpers/session_helpers.rb @@ -1,22 +1,6 @@ # frozen_string_literal: true module SessionHelpers - # Stub a session in Redis, for use in request specs where we can't mock the session directly. - # This also needs the :clean_gitlab_redis_sessions tag on the spec. - def stub_session(session_hash) - unless RSpec.current_example.metadata[:clean_gitlab_redis_sessions] - raise 'Add :clean_gitlab_redis_sessions to your spec!' - end - - session_id = Rack::Session::SessionId.new(SecureRandom.hex) - - Gitlab::Redis::Sessions.with do |redis| - redis.set("session:gitlab:#{session_id.private_id}", Marshal.dump(session_hash)) - end - - cookies[Gitlab::Application.config.session_options[:key]] = session_id.public_id - end - def expect_single_session_with_authenticated_ttl expect_single_session_with_expiration(Settings.gitlab['session_expire_delay'] * 60) end |
