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

settings_spec.rb « pages « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f5424a981530f1736ee5b860b367a9dad14901db (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::Pages::Settings do
  describe '#path' do
    subject { described_class.new(settings).path }

    let(:settings) { double(path: 'the path') }

    it { is_expected.to eq('the path') }

    context 'when running under a web server outside of test mode' do
      before do
        allow(::Gitlab::Runtime).to receive(:test_suite?).and_return(false)
        allow(::Gitlab::Runtime).to receive(:web_server?).and_return(true)
      end

      it 'raises a DiskAccessDenied exception' do
        expect { subject }.to raise_error(described_class::DiskAccessDenied)
      end
    end
  end
end