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

user_configures_pages_pipeline_spec.rb « pages « projects « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 76eec8097d356831b18dd4092ca576feefd4cfd0 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# frozen_string_literal: true
require 'spec_helper'

RSpec.describe 'Pages edits pages settings', :js, feature_category: :pages do
  include Spec::Support::Helpers::ModalHelpers

  let_it_be(:project) { create(:project, pages_https_only: false) }
  let_it_be(:user) { create(:user) }

  before do
    allow(Gitlab.config.pages).to receive(:enabled).and_return(true)

    project.add_maintainer(user)

    sign_in(user)
  end

  context 'when pipeline wizard feature is enabled' do
    before do
      Feature.enable(:use_pipeline_wizard_for_pages)
    end

    context 'when onboarding is not complete' do
      it 'renders onboarding instructions' do
        visit project_pages_path(project)

        expect(page).to have_content('Get started with GitLab Pages')
      end
    end

    context 'when onboarding is complete' do
      before do
        project.mark_pages_onboarding_complete
      end

      it 'shows waiting screen' do
        visit project_pages_path(project)

        expect(page).to have_content('Waiting for the Pages Pipeline to complete...')
      end
    end
  end

  context 'when pipeline wizard feature is disabled' do
    before do
      Feature.disable(:use_pipeline_wizard_for_pages)
    end

    after do
      Feature.enable(:use_pipeline_wizard_for_pages)
    end

    it 'shows configure pages instructions' do
      visit project_pages_path(project)

      expect(page).to have_content('Configure pages')
    end
  end
end