Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cookies_serializer_spec.rb « initializers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6167039d3c25581dafe3b9ebe21d74fcd68a4fd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'Cookies serializer initializer' do
  def load_initializer
    load Rails.root.join('config/initializers/cookies_serializer.rb')
  end

  subject { Rails.application.config.action_dispatch.cookies_serializer }

  it 'uses JSON serializer by default' do
    load_initializer

    expect(subject).to eq(:json)
  end

  it 'uses the unsafe hybrid serializer when the environment variables is set' do
    stub_env('USE_UNSAFE_HYBRID_COOKIES', 'true')

    load_initializer

    expect(subject).to eq(:hybrid)
  end
end