summaryrefslogtreecommitdiff
path: root/spec/helpers/components_helper_spec.rb
blob: 4fa6d27993fb8aa2275593dbc146185a128f2967 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ComponentsHelper do
  describe '#gitlab_workhorse_version' do
    context 'without a Gitlab-Workhorse header' do
      it 'shows the version from Gitlab::Workhorse.version' do
        expect(helper.gitlab_workhorse_version).to eq Gitlab::Workhorse.version
      end
    end

    context 'with a Gitlab-Workhorse header' do
      before do
        helper.request.headers['Gitlab-Workhorse'] = '42.42.0-rc3'
      end

      it 'shows the actual GitLab Workhorse version currently in use' do
        expect(helper.gitlab_workhorse_version).to eq '42.42.0'
      end
    end
  end
end