diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/features/groups/settings | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/features/groups/settings')
-rw-r--r-- | spec/features/groups/settings/ci_cd_spec.rb | 81 |
1 files changed, 51 insertions, 30 deletions
diff --git a/spec/features/groups/settings/ci_cd_spec.rb b/spec/features/groups/settings/ci_cd_spec.rb index 8851aeb6381..c5ad524e647 100644 --- a/spec/features/groups/settings/ci_cd_spec.rb +++ b/spec/features/groups/settings/ci_cd_spec.rb @@ -5,52 +5,73 @@ require 'spec_helper' RSpec.describe 'Group CI/CD settings' do include WaitForRequests - let(:user) { create(:user) } - let(:group) { create(:group) } + let_it_be(:user) { create(:user) } + let_it_be(:group, reload: true) { create(:group) } - before do + before_all do group.add_owner(user) + end + + before do sign_in(user) end - describe 'new group runners view banner' do - it 'displays banner' do - visit group_settings_ci_cd_path(group) + describe 'Runners section' do + let(:shared_runners_toggle) { page.find('[data-testid="enable-runners-toggle"]') } + + context 'with runner_list_group_view_vue_ui enabled' do + before do + visit group_settings_ci_cd_path(group) + end + + it 'displays the new group runners view banner' do + expect(page).to have_content(s_('Runners|New group runners view')) + expect(page).to have_link(href: group_runners_path(group)) + end - expect(page).to have_content(s_('Runners|New group runners view')) - expect(page).to have_link(href: group_runners_path(group)) + it 'has "Enable shared runners for this group" toggle', :js do + expect(shared_runners_toggle).to have_content(_('Enable shared runners for this group')) + end end - it 'does not display banner' do - stub_feature_flags(runner_list_group_view_vue_ui: false) + context 'with runner_list_group_view_vue_ui disabled' do + before do + stub_feature_flags(runner_list_group_view_vue_ui: false) - visit group_settings_ci_cd_path(group) + visit group_settings_ci_cd_path(group) + end - expect(page).not_to have_content(s_('Runners|New group runners view')) - expect(page).not_to have_link(href: group_runners_path(group)) - end - end + it 'does not display the new group runners view banner' do + expect(page).not_to have_content(s_('Runners|New group runners view')) + expect(page).not_to have_link(href: group_runners_path(group)) + end - describe 'runners registration token' do - let!(:token) { group.runners_token } + it 'has "Enable shared runners for this group" toggle', :js do + expect(shared_runners_toggle).to have_content(_('Enable shared runners for this group')) + end - before do - visit group_settings_ci_cd_path(group) - end + context 'with runners registration token' do + let!(:token) { group.runners_token } - it 'has a registration token' do - expect(page.find('#registration_token')).to have_content(token) - end + before do + visit group_settings_ci_cd_path(group) + end - describe 'reload registration token' do - let(:page_token) { find('#registration_token').text } + it 'displays the registration token' do + expect(page.find('#registration_token')).to have_content(token) + end - before do - click_button 'Reset registration token' - end + describe 'reload registration token' do + let(:page_token) { find('#registration_token').text } + + before do + click_button 'Reset registration token' + end - it 'changes registration token' do - expect(page_token).not_to eq token + it 'changes the registration token' do + expect(page_token).not_to eq token + end + end end end end |