Commit 57900720 authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Rémy Coutable

Enable Capybara/FeatureMethods cop (EE-port)

parent 0cc2caaf
......@@ -10,10 +10,6 @@
Capybara/CurrentPathExpectation:
Enabled: false
# Offense count: 956
Capybara/FeatureMethods:
Enabled: false
# Offense count: 23
FactoryBot/DynamicAttributeDefinedStatically:
Exclude:
......
require 'spec_helper'
feature 'Admin updates EE-only settings' do
describe 'Admin updates EE-only settings' do
include StubENV
before do
......@@ -10,7 +10,7 @@ feature 'Admin updates EE-only settings' do
visit admin_application_settings_path
end
scenario 'Modify GitLab Geo settings' do
it 'Modify GitLab Geo settings' do
page.within('.as-geo') do
fill_in 'Connection timeout', with: 15
click_button 'Save changes'
......@@ -20,7 +20,7 @@ feature 'Admin updates EE-only settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Enable external authentication' do
it 'Enable external authentication' do
page.within('.as-external-auth') do
check 'Enable classification control using an external service'
fill_in 'Default classification label', with: 'default'
......@@ -30,7 +30,7 @@ feature 'Admin updates EE-only settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Enable elastic search indexing' do
it 'Enable elastic search indexing' do
page.within('.as-elasticsearch') do
check 'Elasticsearch indexing'
click_button 'Save changes'
......@@ -40,7 +40,7 @@ feature 'Admin updates EE-only settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Enable Slack application' do
it 'Enable Slack application' do
allow(Gitlab).to receive(:com?).and_return(true)
visit admin_application_settings_path
......
require 'spec_helper'
feature 'Burndown charts' do
describe 'Burndown charts' do
let(:current_user) { create(:user) }
let(:milestone) do
create(:milestone, project: project,
......
require 'spec_helper'
feature 'CI shared runner settings' do
describe 'CI shared runner settings' do
include StubENV
let(:admin) { create(:admin) }
......@@ -13,7 +13,7 @@ feature 'CI shared runner settings' do
end
context 'without global shared runners quota' do
scenario 'should display ratio with global quota' do
it 'should display ratio with global quota' do
visit_admin_group_path
expect(page).to have_content("Pipeline minutes quota: 400 / Unlimited")
expect(page).to have_selector('.shared_runners_limit_disabled')
......@@ -25,20 +25,20 @@ feature 'CI shared runner settings' do
set_admin_shared_runners_minutes 500
end
scenario 'should display ratio with global quota' do
it 'should display ratio with global quota' do
visit_admin_group_path
expect(page).to have_content("Pipeline minutes quota: 400 / 500")
expect(page).to have_selector('.shared_runners_limit_under_quota')
end
scenario 'should display new ratio with overridden group quota' do
it 'should display new ratio with overridden group quota' do
set_group_shared_runners_minutes 300
visit_admin_group_path
expect(page).to have_content("Pipeline minutes quota: 400 / 300")
expect(page).to have_selector('.shared_runners_limit_over_quota')
end
scenario 'should display unlimited ratio with overridden group quota' do
it 'should display unlimited ratio with overridden group quota' do
set_group_shared_runners_minutes 0
visit_admin_group_path
expect(page).to have_content("Pipeline minutes quota: 400 / Unlimited")
......
require 'spec_helper'
feature 'CI shared runner limits' do
describe 'CI shared runner limits' do
let(:user) { create(:user) }
let!(:project) { create(:project, :repository, namespace: group, shared_runners_enabled: true) }
let(:group) { create(:group) }
......@@ -15,12 +15,12 @@ feature 'CI shared runner limits' do
end
context 'without limit' do
scenario 'it does not display a warning message on project homepage' do
it 'it does not display a warning message on project homepage' do
visit_project_home
expect_no_quota_exceeded_alert
end
scenario 'it does not display a warning message on pipelines page' do
it 'it does not display a warning message on pipelines page' do
visit_project_pipelines
expect_no_quota_exceeded_alert
end
......@@ -30,12 +30,12 @@ feature 'CI shared runner limits' do
context 'when limit is exceeded' do
let(:group) { create(:group, :with_used_build_minutes_limit) }
scenario 'it displays a warning message on project homepage' do
it 'it displays a warning message on project homepage' do
visit_project_home
expect_quota_exceeded_alert("#{group.name} has exceeded their pipeline minutes quota.")
end
scenario 'it displays a warning message on pipelines page' do
it 'it displays a warning message on pipelines page' do
visit_project_pipelines
expect_quota_exceeded_alert("#{group.name} has exceeded their pipeline minutes quota.")
end
......@@ -44,12 +44,12 @@ feature 'CI shared runner limits' do
context 'when limit not yet exceeded' do
let(:group) { create(:group, :with_not_used_build_minutes_limit) }
scenario 'it does not display a warning message on project homepage' do
it 'it does not display a warning message on project homepage' do
visit_project_home
expect_no_quota_exceeded_alert
end
scenario 'it does not display a warning message on pipelines page' do
it 'it does not display a warning message on pipelines page' do
visit_project_pipelines
expect_no_quota_exceeded_alert
end
......@@ -58,12 +58,12 @@ feature 'CI shared runner limits' do
context 'when minutes are not yet set' do
let(:group) { create(:group, :with_build_minutes_limit) }
scenario 'it does not display a warning message on project homepage' do
it 'it does not display a warning message on project homepage' do
visit_project_home
expect_no_quota_exceeded_alert
end
scenario 'it does not display a warning message on pipelines page' do
it 'it does not display a warning message on pipelines page' do
visit_project_pipelines
expect_no_quota_exceeded_alert
end
......@@ -75,12 +75,12 @@ feature 'CI shared runner limits' do
let(:group) { create(:group, :with_used_build_minutes_limit) }
context 'when limit is defined and limit is exceeded' do
scenario 'it does not display a warning message on project homepage' do
it 'it does not display a warning message on project homepage' do
visit_project_home
expect_no_quota_exceeded_alert
end
scenario 'it does not display a warning message on pipelines page' do
it 'it does not display a warning message on pipelines page' do
visit_project_pipelines
expect_no_quota_exceeded_alert
end
......
require 'spec_helper'
feature 'The group dashboard' do
describe 'The group dashboard' do
include ExternalAuthorizationServiceHelpers
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'Delete Epic', :js do
describe 'Delete Epic', :js do
let(:user) { create(:user) }
let(:group) { create(:group, :public) }
let(:epic) { create(:epic, group: group) }
......
require 'spec_helper'
feature 'New Epic', :js do
describe 'New Epic', :js do
let(:user) { create(:user) }
let(:group) { create(:group, :public) }
......
require 'rails_helper'
feature 'Manually create a todo item from epic', :js do
describe 'Manually create a todo item from epic', :js do
let(:group) { create(:group) }
let(:epic) { create(:epic, group: group) }
let(:user) { create(:user)}
......
require 'spec_helper'
feature 'Update Epic', :js do
describe 'Update Epic', :js do
include DropzoneHelper
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'GEO Nodes' do
describe 'GEO Nodes' do
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:geo_url) { 'http://geo.example.com' }
......
require 'spec_helper'
feature 'Groups > Contribution Analytics', :js do
describe 'Groups > Contribution Analytics', :js do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:empty_project) { create(:project, namespace: group) }
......
require 'spec_helper'
feature 'Groups > Audit Events', :js do
describe 'Groups > Audit Events', :js do
let(:user) { create(:user) }
let(:pete) { create(:user, name: 'Pete') }
let(:group) { create(:group) }
......
require 'spec_helper'
feature 'The group page' do
describe 'The group page' do
include ExternalAuthorizationServiceHelpers
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'Edit group settings' do
given(:user) { create(:user) }
given(:developer) { create(:user) }
given(:group) { create(:group, path: 'foo') }
describe 'Edit group settings' do
let(:user) { create(:user) }
let(:developer) { create(:user) }
let(:group) { create(:group, path: 'foo') }
background do
before do
group.add_owner(user)
group.add_developer(developer)
sign_in(user)
......@@ -18,14 +18,14 @@ feature 'Edit group settings' do
allow(Gitlab::Auth::LDAP::Config).to receive(:enabled?).and_return(true)
end
scenario 'is able to navigate to LDAP group section' do
it 'is able to navigate to LDAP group section' do
visit edit_group_path(group)
expect(find('.nav-sidebar')).to have_content('LDAP Synchronization')
end
context 'with owners not being able to manage LDAP' do
scenario 'is not able to navigate to LDAP group section' do
it 'is not able to navigate to LDAP group section' do
stub_application_setting(allow_group_owners_to_manage_ldap: false)
visit edit_group_path(group)
......
require 'spec_helper'
feature 'Edit group settings', :js do
describe 'Edit group settings', :js do
include Select2Helper
given(:user) { create(:user) }
given(:group) { create(:group, path: 'foo') }
let(:user) { create(:user) }
let(:group) { create(:group, path: 'foo') }
background do
before do
group.add_owner(user)
sign_in(user)
end
......@@ -23,7 +23,7 @@ feature 'Edit group settings', :js do
visit group_ldap_group_links_path(group)
end
scenario 'adds new LDAP synchronization', :js do
it 'adds new LDAP synchronization', :js do
page.within('form#new_ldap_group_link') do
select2 'my-group-cn', from: '#ldap_group_link_cn'
select 'Developer', from: 'ldap_group_link_group_access'
......@@ -35,14 +35,14 @@ feature 'Edit group settings', :js do
expect(page).to have_content('As Developer on ldap server')
end
scenario 'shows the LDAP filter section' do
it 'shows the LDAP filter section' do
choose('sync_method_filter')
expect(page).to have_content('This query must use valid LDAP Search Filter Syntax')
expect(page).not_to have_content("Synchronize #{group.name}'s members with this LDAP group")
end
scenario 'shows the LDAP group section' do
it 'shows the LDAP group section' do
choose('sync_method_filter') # choose filter first, as group's the default
choose('sync_method_group')
......@@ -58,15 +58,15 @@ feature 'Edit group settings', :js do
visit group_ldap_group_links_path(group)
end
scenario 'does not show the LDAP search method switcher' do
it 'does not show the LDAP search method switcher' do
expect(page).not_to have_field('sync_method_filter')
end
scenario 'shows the LDAP group section' do
it 'shows the LDAP group section' do
expect(page).to have_content("Synchronize #{group.name}'s members with this LDAP group")
end
scenario 'does not shows the LDAP filter section' do
it 'does not shows the LDAP filter section' do
expect(page).not_to have_content('This query must use valid LDAP Search Filter Syntax')
end
end
......
require 'spec_helper'
feature 'Groups > Members > Master/Owner can override LDAP access levels' do
describe 'Groups > Members > Master/Owner can override LDAP access levels' do
include WaitForRequests
let(:johndoe) { create(:user, name: 'John Doe') }
......@@ -13,20 +13,20 @@ feature 'Groups > Members > Master/Owner can override LDAP access levels' do
let!(:ldap_member) { create(:group_member, :guest, group: group, user: johndoe, ldap: true) }
let!(:regular_member) { create(:group_member, :guest, group: group, user: maryjane, ldap: false) }
background do
before do
# We need to actually activate the LDAP config otherwise `Group#ldap_synced?` will always be false!
allow(Gitlab.config.ldap).to receive_messages(enabled: true)
sign_in(owner)
end
scenario 'override not available on project members page', :js do
it 'override not available on project members page', :js do
visit namespace_project_project_members_path(group, project)
expect(page).not_to have_button 'Edit permissions'
end
scenario 'owner cannot override LDAP access level', :js do
it 'owner cannot override LDAP access level', :js do
stub_application_setting(allow_group_owners_to_manage_ldap: false)
visit group_group_members_path(group)
......@@ -38,7 +38,7 @@ feature 'Groups > Members > Master/Owner can override LDAP access levels' do
end
end
scenario 'owner can override LDAP access level', :js do
it 'owner can override LDAP access level', :js do
ldap_override_message = 'John Doe is currently an LDAP user. Editing their permissions will override the settings from the LDAP group sync.'
visit group_group_members_path(group)
......
require 'spec_helper'
feature 'Groups > Pipeline Quota' do
describe 'Groups > Pipeline Quota' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let!(:project) { create(:project, namespace: group, shared_runners_enabled: true) }
......
require 'spec_helper'
feature 'SAML provider settings' do
describe 'SAML provider settings' do
include CookieHelper
let(:user) { create(:user) }
......
require 'rails_helper'
feature 'Issue Sidebar' do
describe 'Issue Sidebar' do
include MobileHelpers
let(:group) { create(:group, :nested) }
......
require 'spec_helper'
feature 'Labels Hierarchy', :js, :nested_groups do
describe 'Labels Hierarchy', :js, :nested_groups do
let!(:user) { create(:user) }
let!(:grandparent) { create(:group) }
let!(:parent) { create(:group, parent: grandparent) }
......
require 'rails_helper'
feature 'Merge request > User approves', :js do
describe 'Merge request > User approves', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public, :repository, approvals_before_merge: 1) }
let(:merge_request) { create(:merge_request, source_project: project) }
......
require 'spec_helper'
feature 'Merge request > User merges with Push Rules', :js do
describe 'Merge request > User merges with Push Rules', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public, :repository, push_rule: push_rule) }
let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: 'Bug NS-04') }
......
require 'rails_helper'
feature 'Merge request > User sees approval widget', :js do
describe 'Merge request > User sees approval widget', :js do
let(:project) { create(:project, :public, :repository, approvals_before_merge: 1) }
let(:user) { project.creator }
let(:merge_request) { create(:merge_request, source_project: project) }
......
require 'rails_helper'
feature 'Merge request > User sets approvers', :js do
describe 'Merge request > User sets approvers', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public, :repository, approvals_before_merge: 1) }
......
require 'spec_helper'
feature 'Projects > Audit Events', :js do
describe 'Projects > Audit Events', :js do
let(:user) { create(:user) }
let(:pete) { create(:user, name: 'Pete') }
let(:project) { create(:project, :repository, namespace: user.namespace) }
......
require 'spec_helper'
feature 'Gcp Cluster', :js do
describe 'Gcp Cluster', :js do
include GoogleApi::CloudPlatformHelpers
let(:project) { create(:project) }
......
require 'spec_helper'
feature 'EE Clusters', :js do
describe 'EE Clusters', :js do
include GoogleApi::CloudPlatformHelpers
let(:project) { create(:project) }
......
require 'spec_helper'
feature 'Environment > Pod Logs', :js do
describe 'Environment > Pod Logs', :js do
include KubernetesHelpers
given(:pod_names) { %w(foo bar) }
given(:pod_name) { pod_names.first }
given(:project) { create(:project, :repository) }
given(:environment) { create(:environment, project: project) }
let(:pod_names) { %w(foo bar) }
let(:pod_name) { pod_names.first }
let(:project) { create(:project, :repository) }
let(:environment) { create(:environment, project: project) }
background do
before do
stub_licensed_features(pod_logs: true)
create(:cluster, :provided_by_gcp, environment_scope: '*', projects: [project])
......@@ -21,7 +21,7 @@ feature 'Environment > Pod Logs', :js do
end
context 'with logs' do
scenario "shows pod logs" do
it "shows pod logs" do
visit logs_project_environment_path(environment.project, environment, pod_name: pod_name)
wait_for_requests
......
require 'rails_helper'
feature 'Geo clone instructions', :js do
describe 'Geo clone instructions', :js do
include Devise::Test::IntegrationHelpers
include ::EE::GeoHelpers
let(:project) { create(:project, :empty_repo) }
let(:developer) { create(:user) }
background do
before do
primary = create(:geo_node, :primary, url: 'https://primary.domain.com')
primary.update_columns(clone_url_prefix: 'git@primary.domain.com:')
secondary = create(:geo_node)
......@@ -19,11 +19,11 @@ feature 'Geo clone instructions', :js do
end
context 'with an SSH key' do
background do
before do
create(:personal_key, user: developer)
end
scenario 'defaults to SSH' do
it 'defaults to SSH' do
visit_project
show_geo_clone_instructions
......@@ -31,7 +31,7 @@ feature 'Geo clone instructions', :js do
expect_instructions_for('ssh')
end
scenario 'switches to HTTP' do
it 'switches to HTTP' do
visit_project
select_protocol('HTTP')
......
require 'spec_helper'
require 'tempfile'
feature 'Jobs', :clean_gitlab_redis_shared_state do
describe 'Jobs', :clean_gitlab_redis_shared_state do
let(:user) { create(:user) }
let(:user_access_level) { :developer }
let(:pipeline) { create(:ci_pipeline, project: project) }
......
require 'spec_helper'
feature 'Projects > Members > Member is removed from project' do
describe 'Projects > Members > Member is removed from project' do
let(:user) { create(:user) }
let(:project) { create(:project) }
background do
before do
project.add_master(user)
sign_in(user)
visit project_project_members_path(project)
end
scenario 'user is removed from project' do
it 'user is removed from project' do
click_link 'Leave'
expect(project.users.exists?(user.id)).to be_falsey
......@@ -21,7 +21,7 @@ feature 'Projects > Members > Member is removed from project' do
let!(:matching_protected_branch) { create(:protected_branch, authorize_user_to_push: user, authorize_user_to_merge: user, project: project) }
let!(:non_matching_protected_branch) { create(:protected_branch, authorize_user_to_push: other_user, authorize_user_to_merge: other_user, project: project) }
scenario 'user leaves project' do
it 'user leaves project' do
click_link 'Leave'
expect(project.users.exists?(user.id)).to be_falsey
......
require 'spec_helper'
feature 'Projects > Members > Member leaves project' do
describe 'Projects > Members > Member leaves project' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
background do
before do
project.add_developer(user)
sign_in(user)
visit project_path(project)
......@@ -16,7 +16,7 @@ feature 'Projects > Members > Member leaves project' do
let!(:non_matching_protected_branch) { create(:protected_branch, authorize_user_to_push: other_user, authorize_user_to_merge: other_user, project: project) }
context 'user leaves project' do
scenario "removes the user's branch permissions" do
it "removes the user's branch permissions" do
click_link 'Leave project'
expect(current_path).to eq(dashboard_projects_path)
......
require 'spec_helper'
feature 'Project mirror', :js do
describe 'Project mirror', :js do
include ReactiveCachingHelpers
let(:project) { create(:project, :repository, creator: user, name: 'Victorialand') }
......
require 'spec_helper'
feature 'New project' do
describe 'New project' do
let(:user) { create(:admin) }
before do
......
require 'spec_helper'
feature 'Path Locks', :js do
describe 'Path Locks', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, namespace: user.namespace) }
let(:tree_path) { project_tree_path(project, project.repository.root_ref) }
......@@ -14,7 +14,7 @@ feature 'Path Locks', :js do
visit tree_path
end
scenario 'Locking folders' do
it 'Locking folders' do
within '.tree-content-holder' do
click_link "encoding"
end
......@@ -27,7 +27,7 @@ feature 'Path Locks', :js do
expect(page).to have_selector('.fa-lock')
end
scenario 'Locking files' do
it 'Locking files' do
page_tree = find('.tree-content-holder')
within page_tree do
......@@ -47,7 +47,7 @@ feature 'Path Locks', :js do
end
end
scenario 'Unlocking files' do
it 'Unlocking files' do
within find('.tree-content-holder') do
click_link "VERSION"
end
......@@ -65,7 +65,7 @@ feature 'Path Locks', :js do
end
end
scenario 'Managing of lock list' do
it 'Managing of lock list' do
create :path_lock, path: 'encoding', user: user, project: project
click_link "Locked Files"
......
require 'spec_helper'
feature 'Projects > Push Rules', :js do
describe 'Projects > Push Rules', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, namespace: user.namespace) }
let(:foo) {{ reject_unsigned_commits: 'Reject unsigned commits' }}
......
require 'spec_helper'
feature 'Project settings > Issues', :js do
describe 'Project settings > Issues', :js do
let(:project) { create(:project, :public) }
let(:user) { create(:user) }
background do
before do
project.add_master(user)
sign_in(user)
......@@ -16,7 +16,7 @@ feature 'Project settings > Issues', :js do
visit edit_project_path(project)
end
scenario 'shows the Issues settings' do
it 'shows the Issues settings' do
expect(page).to have_content('Customize your issue restrictions')
within('.sharing-permissions-form') do
......@@ -35,7 +35,7 @@ feature 'Project settings > Issues', :js do
visit edit_project_path(project)
end
scenario 'does not show the Issues settings' do
it 'does not show the Issues settings' do
expect(page).not_to have_content('Customize your issue restrictions')
within('.sharing-permissions-form') do
......@@ -52,7 +52,7 @@ feature 'Project settings > Issues', :js do
stub_licensed_features(issuable_default_templates: false)
end
scenario 'input to configure issue template is not shown' do
it 'input to configure issue template is not shown' do
visit edit_project_path(project)
expect(page).not_to have_selector('#project_issues_template')
......@@ -64,7 +64,7 @@ feature 'Project settings > Issues', :js do
stub_licensed_features(issuable_default_templates: true)
end
scenario 'input to configure issue template is not shown' do
it 'input to configure issue template is not shown' do
visit edit_project_path(project)
expect(page).to have_selector('#project_issues_template')
......
......@@ -16,7 +16,7 @@ describe 'Project settings > [EE] Merge Requests', :js do
group.add_developer(group_member)
end
scenario 'adds approver' do
it 'adds approver' do
visit edit_project_path(project)
find('#s2id_approver_user_and_group_ids .select2-input').click
......@@ -34,7 +34,7 @@ describe 'Project settings > [EE] Merge Requests', :js do
expect(find('.select2-results')).not_to have_content(user.name)
end
scenario 'filter approvers' do
it 'filter approvers' do
visit edit_project_path(project)
find('.js-select-user-and-group').click
......@@ -42,7 +42,7 @@ describe 'Project settings > [EE] Merge Requests', :js do
expect(find('.select2-results')).not_to have_content(non_member.name)
end
scenario 'adds approver group' do
it 'adds approver group' do
visit edit_project_path(project)
find('#s2id_approver_user_and_group_ids .select2-input').click
......@@ -71,7 +71,7 @@ describe 'Project settings > [EE] Merge Requests', :js do
create(:approver_group, group: group, target: project)
end
scenario 'removes approver group' do
it 'removes approver group' do
visit edit_project_path(project)
expect(find('.js-current-approvers')).to have_content(group.name)
......@@ -89,7 +89,7 @@ describe 'Project settings > [EE] Merge Requests', :js do
stub_licensed_features(issuable_default_templates: false)
end
scenario 'input to configure merge request template is not shown' do
it 'input to configure merge request template is not shown' do
visit edit_project_path(project)
expect(page).not_to have_selector('#project_merge_requests_template')
......@@ -101,7 +101,7 @@ describe 'Project settings > [EE] Merge Requests', :js do
stub_licensed_features(issuable_default_templates: true)
end
scenario 'input to configure merge request template is not shown' do
it 'input to configure merge request template is not shown' do
visit edit_project_path(project)
expect(page).to have_selector('#project_merge_requests_template')
......
require 'spec_helper'
feature 'Slack application' do
describe 'Slack application' do
let(:project) { create(:project) }
let(:user) { create(:user) }
let(:role) { :developer }
let(:service) { create(:gitlab_slack_application_service, project: project) }
let(:slack_application_form_path) { edit_project_service_path(project, service) }
background do
before do
gitlab_sign_in(user)
project.add_master(user)
......@@ -16,7 +16,7 @@ feature 'Slack application' do
allow(Gitlab).to receive(:com?).and_return(true)
end
scenario 'I can edit slack integration' do
it 'I can edit slack integration' do
visit slack_application_form_path
within '.js-integration-settings-form' do
......
require 'rails_helper'
feature 'Projects > Show > Developer views empty project instructions' do
describe 'Projects > Show > Developer views empty project instructions' do
let(:project) { create(:project, :empty_repo) }
let(:developer) { create(:user) }
background do
before do
project.add_developer(developer)
sign_in(developer)
end
context 'with Kerberos enabled' do
background do
before do
allow(Gitlab.config.kerberos).to receive(:enabled).and_return(true)
end
scenario 'defaults to KRB5' do
it 'defaults to KRB5' do
visit project_path(project)
expect(page).to have_content("git clone #{project.kerberos_url_to_repo}")
......
require 'spec_helper'
feature 'Global elastic search' do
describe 'Global elastic search' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, :wiki_repo, namespace: user.namespace) }
......
require 'spec_helper'
feature 'Group elastic search', :js do
describe 'Group elastic search', :js do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, :repository, :wiki_repo, namespace: group) }
......
require 'spec_helper'
feature 'Signup on EE' do
describe 'Signup on EE' do
let(:user_attrs) { attributes_for(:user) }
context 'for Gitlab.com' do
......
require 'spec_helper'
feature 'Login' do
describe 'Login' do
before do
stub_licensed_features(extended_audit_events: true)
end
......
require 'securerandom'
module QA
feature 'API basics', :core do
describe 'API basics', :core do
before(:context) do
@api_client = Runtime::API::Client.new(:gitlab)
end
......@@ -9,7 +9,7 @@ module QA
let(:project_name) { "api-basics-#{SecureRandom.hex(8)}" }
let(:sanitized_project_path) { CGI.escape("#{Runtime::User.name}/#{project_name}") }
scenario 'user creates a project with a file and deletes them afterwards' do
it 'user creates a project with a file and deletes them afterwards' do
create_project_request = Runtime::API::Request.new(@api_client, '/projects')
post create_project_request.url, path: project_name, name: project_name
......
module QA
feature 'API users', :core do
describe 'API users', :core do
before(:context) do
@api_client = Runtime::API::Client.new(:gitlab)
end
......@@ -7,13 +7,13 @@ module QA
context 'when authenticated' do
let(:request) { Runtime::API::Request.new(@api_client, '/users') }
scenario 'get list of users' do
it 'get list of users' do
get request.url
expect_status(200)
end
scenario 'submit request with a valid user name' do
it 'submit request with a valid user name' do
get request.url, { params: { username: Runtime::User.name } }
expect_status(200)
......@@ -22,7 +22,7 @@ module QA
)
end
scenario 'submit request with an invalid user name' do
it 'submit request with an invalid user name' do
get request.url, { params: { username: SecureRandom.hex(10) } }
expect_status(200)
......@@ -30,7 +30,7 @@ module QA
end
end
scenario 'submit request with an invalid token' do
it 'submit request with an invalid token' do
request = Runtime::API::Request.new(@api_client, '/users', private_token: 'invalid')
get request.url
......
......@@ -5,7 +5,7 @@ module QA
end
shared_examples 'retrieving configuration about Geo nodes' do
scenario 'GET /geo_nodes' do
it 'GET /geo_nodes' do
get api_endpoint('/geo_nodes')
expect_status(200)
......@@ -16,7 +16,7 @@ module QA
clone_protocol: :string, _links: :object)
end
scenario 'GET /geo_nodes/:id' do
it 'GET /geo_nodes/:id' do
get api_endpoint("/geo_nodes/#{geo_node[:id]}")
expect_status(200)
......@@ -25,7 +25,7 @@ module QA
end
shared_examples 'retrieving status about all Geo nodes' do
scenario 'GET /geo_nodes/status' do
it 'GET /geo_nodes/status' do
get api_endpoint('/geo_nodes/status')
expect_status(200)
......@@ -45,21 +45,21 @@ module QA
end
shared_examples 'retrieving status about a specific Geo node' do
scenario 'GET /geo_nodes/:id/status of primary node' do
it 'GET /geo_nodes/:id/status of primary node' do
get api_endpoint("/geo_nodes/#{@primary_node[:id]}/status")
expect_status(200)
expect_json(geo_node_id: @primary_node[:id])
end
scenario 'GET /geo_nodes/:id/status of secondary node' do
it 'GET /geo_nodes/:id/status of secondary node' do
get api_endpoint("/geo_nodes/#{@secondary_node[:id]}/status")
expect_status(200)
expect_json(geo_node_id: @secondary_node[:id])
end
scenario 'GET /geo_nodes/:id/status of an invalid node' do
it 'GET /geo_nodes/:id/status of an invalid node' do
get api_endpoint("/geo_nodes/1000/status")
expect_status(404)
......@@ -67,7 +67,7 @@ module QA
end
shared_examples 'retrieving project sync failures ocurred on the current node' do
scenario 'GET /geo_nodes/current/failures' do
it 'GET /geo_nodes/current/failures' do
get api_endpoint("/geo_nodes/current/failures")
expect_status(200)
......@@ -75,7 +75,7 @@ module QA
end
end
feature 'Geo Nodes API on primary node', :geo do
describe 'Geo Nodes API on primary node', :geo do
before(:context) do
fetch_nodes(:geo_primary)
end
......@@ -87,15 +87,15 @@ module QA
include_examples 'retrieving status about all Geo nodes'
include_examples 'retrieving status about a specific Geo node'
feature 'editing a Geo node' do
scenario 'PUT /geo_nodes/:id for primary node' do
describe 'editing a Geo node' do
it 'PUT /geo_nodes/:id for primary node' do
put api_endpoint("/geo_nodes/#{@primary_node[:id]}"),
{ params: { files_max_capacity: 1000 } }
expect_status(403)
end
scenario 'PUT /geo_nodes/:id for secondary node' do
it 'PUT /geo_nodes/:id for secondary node' do
endpoint = api_endpoint("/geo_nodes/#{@secondary_node[:id]}")
new_attributes = { enabled: false, files_max_capacity: 1000, repos_max_capacity: 2000 }
......@@ -112,7 +112,7 @@ module QA
expect_status(200)
end
scenario 'PUT /geo_nodes/:id for an invalid node' do
it 'PUT /geo_nodes/:id for an invalid node' do
put api_endpoint("/geo_nodes/1000"),
{ params: { files_max_capacity: 1000 } }
......@@ -120,22 +120,22 @@ module QA
end
end
feature 'repairing a Geo node' do
scenario 'POST /geo_nodes/:id/repair for primary node' do
describe 'repairing a Geo node' do
it 'POST /geo_nodes/:id/repair for primary node' do
post api_endpoint("/geo_nodes/#{@primary_node[:id]}/repair")
expect_status(200)
expect_json(geo_node_id: @primary_node[:id])
end
scenario 'POST /geo_nodes/:id/repair for secondary node' do
it 'POST /geo_nodes/:id/repair for secondary node' do
post api_endpoint("/geo_nodes/#{@secondary_node[:id]}/repair")
expect_status(200)
expect_json(geo_node_id: @secondary_node[:id])
end
scenario 'POST /geo_nodes/:id/repair for an invalid node' do
it 'POST /geo_nodes/:id/repair for an invalid node' do
post api_endpoint("/geo_nodes/1000/repair")
expect_status(404)
......@@ -143,7 +143,7 @@ module QA
end
end
feature 'Geo Nodes API on secondary node', :geo do
describe 'Geo Nodes API on secondary node', :geo do
before(:context) do
fetch_nodes(:geo_secondary)
end
......@@ -156,29 +156,29 @@ module QA
include_examples 'retrieving status about a specific Geo node'
include_examples 'retrieving project sync failures ocurred on the current node'
scenario 'GET /geo_nodes is not current' do
it 'GET /geo_nodes is not current' do
get api_endpoint('/geo_nodes')
expect_status(200)
expect_json('?', current: false)
end
feature 'editing a Geo node' do
scenario 'PUT /geo_nodes/:id for primary node' do
describe 'editing a Geo node' do
it 'PUT /geo_nodes/:id for primary node' do
put api_endpoint("/geo_nodes/#{@primary_node[:id]}"),
{ params: { files_max_capacity: 1000 } }
expect_status(403)
end
scenario 'PUT /geo_nodes/:id for secondary node' do
it 'PUT /geo_nodes/:id for secondary node' do
put api_endpoint("/geo_nodes/#{@secondary_node[:id]}"),
{ params: { files_max_capacity: 1000 } }
expect_status(403)
end
scenario 'PUT /geo_nodes/:id for an invalid node' do
it 'PUT /geo_nodes/:id for an invalid node' do
put api_endpoint('/geo_nodes/1000'),
{ params: { files_max_capacity: 1000 } }
......@@ -186,20 +186,20 @@ module QA
end
end
feature 'repairing a Geo node' do
scenario 'POST /geo_nodes/:id/repair for primary node' do
describe 'repairing a Geo node' do
it 'POST /geo_nodes/:id/repair for primary node' do
post api_endpoint("/geo_nodes/#{@primary_node[:id]}/repair")
expect_status(403)
end
scenario 'POST /geo_nodes/:id/repair for secondary node' do
it 'POST /geo_nodes/:id/repair for secondary node' do
post api_endpoint("/geo_nodes/#{@secondary_node[:id]}/repair")
expect_status(403)
end
scenario 'POST /geo_nodes/:id/repair for an invalid node' do
it 'POST /geo_nodes/:id/repair for an invalid node' do
post api_endpoint('/geo_nodes/1000/repair')
expect_status(403)
......
module QA
feature 'GitLab Geo attachment replication', :geo do
describe 'GitLab Geo attachment replication', :geo do
let(:file_to_attach) { File.absolute_path(File.join('spec', 'fixtures', 'banana_sample.gif')) }
scenario 'user uploads attachment to the primary node' do
it 'user uploads attachment to the primary node' do
Runtime::Browser.visit(:geo_primary, QA::Page::Main::Login) do
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'GitLab Geo project rename replication', :geo do
scenario 'user renames project' do
describe 'GitLab Geo project rename replication', :geo do
it 'user renames project' do
# create the project and push code
Runtime::Browser.visit(:geo_primary, QA::Page::Main::Login) do
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'GitLab Geo repository replication', :geo do
scenario 'users pushes code to the primary node' do
describe 'GitLab Geo repository replication', :geo do
it 'users pushes code to the primary node' do
Runtime::Browser.visit(:geo_primary, QA::Page::Main::Login) do
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'LDAP user login', :ldap do
describe 'LDAP user login', :ldap do
before do
Runtime::Env.user_type = 'ldap'
end
scenario 'user logs in using LDAP credentials' do
it 'user logs in using LDAP credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'standard user login', :core do
scenario 'user logs in using credentials' do
describe 'standard user login', :core do
it 'user logs in using credentials' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'create a new group', :mattermost do
scenario 'creating a group with a mattermost team' do
describe 'create a new group', :mattermost do
it 'creating a group with a mattermost team' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
Page::Menu::Main.act { go_to_groups }
......
module QA
feature 'logging in to Mattermost', :mattermost do
scenario 'can use gitlab oauth' do
describe 'logging in to Mattermost', :mattermost do
it 'can use gitlab oauth' do
Runtime::Browser.visit(:gitlab, Page::Main::Login) do
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'creates a merge request', :core do
scenario 'user creates a new merge request' do
describe 'creates a merge request', :core do
it 'user creates a new merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'merge request rebase', :core do
scenario 'rebases source branch of merge request' do
describe 'merge request rebase', :core do
it 'rebases source branch of merge request' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'merge request squash commits', :core do
scenario 'when squash commits is marked before merge' do
describe 'merge request squash commits', :core do
it 'when squash commits is marked before merge' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'activity page', :core do
scenario 'push creates an event in the activity page' do
describe 'activity page', :core do
it 'push creates an event in the activity page' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'deploy keys support', :core do
scenario 'user adds a deploy key' do
describe 'deploy keys support', :core do
it 'user adds a deploy key' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'secret variables support', :core do
scenario 'user adds a secret variable' do
describe 'secret variables support', :core do
it 'user adds a secret variable' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
require 'pathname'
module QA
feature 'Auto Devops', :kubernetes do
describe 'Auto Devops', :kubernetes do
after do
@cluster&.remove!
end
scenario 'user creates a new project and runs auto devops' do
it 'user creates a new project and runs auto devops' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'creates issue', :core do
describe 'creates issue', :core do
let(:issue_title) { 'issue title' }
scenario 'user creates issue' do
it 'user creates issue' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'create a new project', :core do
scenario 'user creates a new project' do
describe 'create a new project', :core do
it 'user creates a new project' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
require 'digest/sha1'
module QA
feature 'cloning code using a deploy key', :core, :docker do
describe 'cloning code using a deploy key', :core, :docker do
def login
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......@@ -39,7 +39,7 @@ module QA
]
keys.each do |(key_class, bits)|
scenario "user sets up a deploy key with #{key_class}(#{bits}) to clone code using pipelines" do
it "user sets up a deploy key with #{key_class}(#{bits}) to clone code using pipelines" do
key = key_class.new(*bits)
login
......
module QA
feature 'CI/CD Pipelines', :core, :docker do
describe 'CI/CD Pipelines', :core, :docker do
let(:executor) { "qa-runner-#{Time.now.to_i}" }
after do
Service::Runner.new(executor).remove!
end
scenario 'user registers a new specific runner' do
it 'user registers a new specific runner' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......@@ -25,7 +25,7 @@ module QA
end
end
scenario 'users creates a new pipeline' do
it 'users creates a new pipeline' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
module QA
feature 'Wiki Functionality', :core do
describe 'Wiki Functionality', :core do
def login
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......@@ -14,7 +14,7 @@ module QA
login
end
scenario 'User creates, edits, clones, and pushes to the wiki' do
it 'User creates, edits, clones, and pushes to the wiki' do
wiki = Factory::Resource::Wiki.fabricate! do |resource|
resource.title = 'Home'
resource.content = '# My First Wiki Content'
......
module QA
feature 'clone code from the repository', :core do
describe 'clone code from the repository', :core do
context 'with regular account over http' do
given(:location) do
let(:location) do
Page::Project::Show.act do
choose_repository_clone_http
repository_location
......@@ -31,7 +31,7 @@ module QA
end
end
scenario 'user performs a deep clone' do
it 'user performs a deep clone' do
Git::Repository.perform do |repository|
repository.uri = location.uri
repository.use_default_credentials
......@@ -42,7 +42,7 @@ module QA
end
end
scenario 'user performs a shallow clone' do
it 'user performs a shallow clone' do
Git::Repository.perform do |repository|
repository.uri = location.uri
repository.use_default_credentials
......
module QA
feature 'branch protection support', :core do
given(:branch_name) { 'protected-branch' }
given(:commit_message) { 'Protected push commit message' }
given(:project) do
describe 'branch protection support', :core do
let(:branch_name) { 'protected-branch' }
let(:commit_message) { 'Protected push commit message' }
let(:project) do
Factory::Resource::Project.fabricate! do |resource|
resource.name = 'protected-branch-project'
end
......@@ -27,7 +27,7 @@ module QA
context 'when developers and maintainers are allowed to push to a protected branch' do
let!(:protected_branch) { create_protected_branch(allow_to_push: true) }
scenario 'user with push rights successfully pushes to the protected branch' do
it 'user with push rights successfully pushes to the protected branch' do
expect(protected_branch.name).to have_content(branch_name)
expect(protected_branch.push_allowance).to have_content('Developers + Maintainers')
......@@ -38,7 +38,7 @@ module QA
end
context 'when developers and maintainers are not allowed to push to a protected branch' do
scenario 'user without push rights fails to push to the protected branch' do
it 'user without push rights fails to push to the protected branch' do
create_protected_branch(allow_to_push: false)
@push = push_new_file(branch_name)
......
module QA
feature 'push code to repository', :core do
describe 'push code to repository', :core do
context 'with regular account over http' do
scenario 'user pushes code to the repository' do
it 'user pushes code to the repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.act { sign_in_using_credentials }
......
require 'spec_helper'
feature 'Abuse reports' do
describe 'Abuse reports' do
let(:another_user) { create(:user) }
before do
sign_in(create(:user))
end
scenario 'Report abuse' do
it 'Report abuse' do
visit user_path(another_user)
click_link 'Report abuse'
......
require 'spec_helper'
feature 'Admin Appearance' do
describe 'Admin Appearance' do
let!(:appearance) { create(:appearance) }
scenario 'Create new appearance' do
it 'Create new appearance' do
sign_in(create(:admin))
visit admin_appearances_path
......@@ -21,7 +21,7 @@ feature 'Admin Appearance' do
expect(page).to have_content 'Last edit'
end
scenario 'Preview sign-in page appearance' do
it 'Preview sign-in page appearance' do
sign_in(create(:admin))
visit admin_appearances_path
......@@ -30,7 +30,7 @@ feature 'Admin Appearance' do
expect_custom_sign_in_appearance(appearance)
end
scenario 'Preview new project page appearance' do
it 'Preview new project page appearance' do
sign_in(create(:admin))
visit admin_appearances_path
......@@ -39,20 +39,20 @@ feature 'Admin Appearance' do
expect_custom_new_project_appearance(appearance)
end
scenario 'Custom sign-in page' do
it 'Custom sign-in page' do
visit new_user_session_path
expect_custom_sign_in_appearance(appearance)
end
scenario 'Custom new project page' do
it 'Custom new project page' do
sign_in create(:user)
visit new_project_path
expect_custom_new_project_appearance(appearance)
end
scenario 'Appearance logo' do
it 'Appearance logo' do
sign_in(create(:admin))
visit admin_appearances_path
......@@ -64,7 +64,7 @@ feature 'Admin Appearance' do
expect(page).not_to have_css(logo_selector)
end
scenario 'Header logos' do
it 'Header logos' do
sign_in(create(:admin))
visit admin_appearances_path
......@@ -76,7 +76,7 @@ feature 'Admin Appearance' do
expect(page).not_to have_css(header_logo_selector)
end
scenario 'Favicon' do
it 'Favicon' do
sign_in(create(:admin))
visit admin_appearances_path
......
require 'spec_helper'
feature 'Admin Broadcast Messages' do
describe 'Admin Broadcast Messages' do
before do
sign_in(create(:admin))
create(:broadcast_message, :expired, message: 'Migration to new server')
visit admin_broadcast_messages_path
end
scenario 'See broadcast messages list' do
it 'See broadcast messages list' do
expect(page).to have_content 'Migration to new server'
end
scenario 'Create a customized broadcast message' do
it 'Create a customized broadcast message' do
fill_in 'broadcast_message_message', with: 'Application update from **4:00 CST to 5:00 CST**'
fill_in 'broadcast_message_color', with: '#f2dede'
fill_in 'broadcast_message_font', with: '#b94a48'
......@@ -24,7 +24,7 @@ feature 'Admin Broadcast Messages' do
expect(page).to have_selector %(div[style="background-color: #f2dede; color: #b94a48"])
end
scenario 'Edit an existing broadcast message' do
it 'Edit an existing broadcast message' do
click_link 'Edit'
fill_in 'broadcast_message_message', with: 'Application update RIGHT NOW'
click_button 'Update broadcast message'
......@@ -33,14 +33,14 @@ feature 'Admin Broadcast Messages' do
expect(page).to have_content 'Application update RIGHT NOW'
end
scenario 'Remove an existing broadcast message' do
it 'Remove an existing broadcast message' do
click_link 'Remove'
expect(current_path).to eq admin_broadcast_messages_path
expect(page).not_to have_content 'Migration to new server'
end
scenario 'Live preview a customized broadcast message', :js do
it 'Live preview a customized broadcast message', :js do
fill_in 'broadcast_message_message', with: "Live **Markdown** previews. :tada:"
page.within('.broadcast-message-preview') do
......
......@@ -7,7 +7,7 @@ describe 'Admin browse spam logs' do
sign_in(create(:admin))
end
scenario 'Browse spam logs' do
it 'Browse spam logs' do
visit admin_spam_logs_path
expect(page).to have_content('Spam Logs')
......
require 'rails_helper'
feature 'Admin cohorts page' do
describe 'Admin cohorts page' do
before do
sign_in(create(:admin))
end
scenario 'See users count per month' do
it 'See users count per month' do
2.times { create(:user) }
visit admin_cohorts_path
......
require 'rails_helper'
feature 'Admin disables Git access protocol' do
describe 'Admin disables Git access protocol' do
include StubENV
let(:project) { create(:project, :empty_repo) }
let(:admin) { create(:admin) }
background do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
sign_in(admin)
end
context 'with HTTP disabled' do
background do
before do
disable_http_protocol
end
scenario 'shows only SSH url' do
it 'shows only SSH url' do
visit_project
expect(page).to have_content("git clone #{project.ssh_url_to_repo}")
......@@ -25,11 +25,11 @@ feature 'Admin disables Git access protocol' do
end
context 'with SSH disabled' do
background do
before do
disable_ssh_protocol
end
scenario 'shows only HTTP url' do
it 'shows only HTTP url' do
visit_project
expect(page).to have_content("git clone #{project.http_url_to_repo}")
......@@ -38,11 +38,11 @@ feature 'Admin disables Git access protocol' do
end
context 'with nothing disabled' do
background do
before do
create(:personal_key, user: admin)
end
scenario 'shows default SSH url and protocol selection dropdown' do
it 'shows default SSH url and protocol selection dropdown' do
visit_project
expect(page).to have_content("git clone #{project.ssh_url_to_repo}")
......
require 'rails_helper'
feature 'Admin disables 2FA for a user' do
scenario 'successfully', :js do
describe 'Admin disables 2FA for a user' do
it 'successfully', :js do
sign_in(create(:admin))
user = create(:user, :two_factor)
......@@ -16,7 +16,7 @@ feature 'Admin disables 2FA for a user' do
end
end
scenario 'for a user without 2FA enabled' do
it 'for a user without 2FA enabled' do
sign_in(create(:admin))
user = create(:user)
......
require 'spec_helper'
feature 'Admin Groups' do
describe 'Admin Groups' do
include Select2Helper
let(:internal) { Gitlab::VisibilityLevel::INTERNAL }
......@@ -47,13 +47,13 @@ feature 'Admin Groups' do
expect(li_texts).to match group_description
end
scenario 'shows the visibility level radio populated with the default value' do
it 'shows the visibility level radio populated with the default value' do
visit new_admin_group_path
expect_selected_visibility(internal)
end
scenario 'when entered in group path, it auto filled the group name', :js do
it 'when entered in group path, it auto filled the group name', :js do
visit admin_groups_path
click_link "New group"
group_path = 'gitlab'
......@@ -64,7 +64,7 @@ feature 'Admin Groups' do
end
describe 'show a group' do
scenario 'shows the group' do
it 'shows the group' do
group = create(:group, :private)
visit admin_group_path(group)
......@@ -74,7 +74,7 @@ feature 'Admin Groups' do
end
describe 'group edit' do
scenario 'shows the visibility level radio populated with the group visibility_level value' do
it 'shows the visibility level radio populated with the group visibility_level value' do
group = create(:group, :private)
visit admin_group_edit_path(group)
......@@ -82,7 +82,7 @@ feature 'Admin Groups' do
expect_selected_visibility(group.visibility_level)
end
scenario 'edit group path does not change group name', :js do
it 'edit group path does not change group name', :js do
group = create(:group, :private)
visit admin_group_edit_path(group)
......
require 'spec_helper'
feature "Admin Health Check", :feature do
describe "Admin Health Check", :feature do
include StubENV
before do
......
require 'spec_helper'
feature 'Admin::HookLogs' do
describe 'Admin::HookLogs' do
let(:project) { create(:project) }
let(:system_hook) { create(:system_hook) }
let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') }
......@@ -9,7 +9,7 @@ feature 'Admin::HookLogs' do
sign_in(create(:admin))
end
scenario 'show list of hook logs' do
it 'show list of hook logs' do
hook_log
visit edit_admin_hook_path(system_hook)
......@@ -17,7 +17,7 @@ feature 'Admin::HookLogs' do
expect(page).to have_content(hook_log.url)
end
scenario 'show hook log details' do
it 'show hook log details' do
hook_log
visit edit_admin_hook_path(system_hook)
click_link 'View details'
......@@ -27,7 +27,7 @@ feature 'Admin::HookLogs' do
expect(page).to have_content('Resend Request')
end
scenario 'retry hook log' do
it 'retry hook log' do
WebMock.stub_request(:post, system_hook.url)
hook_log
......
require 'spec_helper'
feature 'Admin updates settings' do
describe 'Admin updates settings' do
include StubENV
include TermsHelper
......@@ -12,7 +12,7 @@ feature 'Admin updates settings' do
visit admin_application_settings_path
end
scenario 'Change visibility settings' do
it 'Change visibility settings' do
page.within('.as-visibility-access') do
choose "application_setting_default_project_visibility_20"
click_button 'Save changes'
......@@ -21,7 +21,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Uncheck all restricted visibility levels' do
it 'Uncheck all restricted visibility levels' do
page.within('.as-visibility-access') do
find('#application_setting_visibility_level_0').set(false)
find('#application_setting_visibility_level_10').set(false)
......@@ -37,7 +37,7 @@ feature 'Admin updates settings' do
describe 'LDAP settings' do
context 'with LDAP enabled' do
scenario 'Change allow group owners to manage ldap' do
it 'Change allow group owners to manage ldap' do
allow(Gitlab::Auth::LDAP::Config).to receive(:enabled?).and_return(true)
visit admin_application_settings_path
......@@ -52,7 +52,7 @@ feature 'Admin updates settings' do
end
context 'with LDAP disabled' do
scenario 'Does not show option to allow group owners to manage ldap' do
it 'Does not show option to allow group owners to manage ldap' do
visit admin_application_settings_path
expect(page).not_to have_css('#application_setting_allow_group_owners_to_manage_ldap')
......@@ -60,7 +60,7 @@ feature 'Admin updates settings' do
end
end
scenario 'Modify import sources' do
it 'Modify import sources' do
expect(Gitlab::CurrentSettings.import_sources).not_to be_empty
page.within('.as-visibility-access') do
......@@ -83,7 +83,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.import_sources).to eq(['git'])
end
scenario 'Change Visibility and Access Controls' do
it 'Change Visibility and Access Controls' do
page.within('.as-visibility-access') do
uncheck 'Project export enabled'
click_button 'Save changes'
......@@ -93,7 +93,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Account and Limit Settings' do
it 'Change Account and Limit Settings' do
page.within('.as-account-limit') do
uncheck 'Gravatar enabled'
click_button 'Save changes'
......@@ -103,7 +103,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Sign-in restrictions' do
it 'Change Sign-in restrictions' do
page.within('.as-signin') do
fill_in 'Home page URL', with: 'https://about.gitlab.com/'
click_button 'Save changes'
......@@ -113,7 +113,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Terms of Service' do
it 'Terms of Service' do
# Already have the admin accept terms, so they don't need to accept in this spec.
_existing_terms = create(:term)
accept_terms(admin)
......@@ -129,7 +129,7 @@ feature 'Admin updates settings' do
expect(page).to have_content 'Application settings saved successfully'
end
scenario 'Modify oauth providers' do
it 'Modify oauth providers' do
expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to be_empty
page.within('.as-signin') do
......@@ -149,7 +149,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).not_to include('google_oauth2')
end
scenario 'Oauth providers do not raise validation errors when saving unrelated changes' do
it 'Oauth providers do not raise validation errors when saving unrelated changes' do
expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to be_empty
page.within('.as-signin') do
......@@ -172,7 +172,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.disabled_oauth_sign_in_sources).to include('google_oauth2')
end
scenario 'Change Help page' do
it 'Change Help page' do
page.within('.as-help-page') do
fill_in 'Help page text', with: 'Example text'
check 'Hide marketing-related entries from help'
......@@ -186,7 +186,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Pages settings' do
it 'Change Pages settings' do
page.within('.as-pages') do
fill_in 'Maximum size of pages (MB)', with: 15
check 'Require users to prove ownership of custom domains'
......@@ -198,7 +198,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change CI/CD settings' do
it 'Change CI/CD settings' do
page.within('.as-ci-cd') do
check 'Enabled Auto DevOps for projects by default'
fill_in 'Auto devops domain', with: 'domain.com'
......@@ -210,7 +210,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Influx settings' do
it 'Change Influx settings' do
page.within('.as-influx') do
check 'Enable InfluxDB Metrics'
click_button 'Save changes'
......@@ -220,7 +220,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Prometheus settings' do
it 'Change Prometheus settings' do
page.within('.as-prometheus') do
check 'Enable Prometheus Metrics'
click_button 'Save changes'
......@@ -230,7 +230,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Performance bar settings' do
it 'Change Performance bar settings' do
group = create(:group)
page.within('.as-performance-bar') do
......@@ -253,7 +253,7 @@ feature 'Admin updates settings' do
expect(find_field('Allowed group').value).to be_nil
end
scenario 'Change Background jobs settings' do
it 'Change Background jobs settings' do
page.within('.as-background') do
fill_in 'Throttling Factor', with: 1
click_button 'Save changes'
......@@ -263,7 +263,7 @@ feature 'Admin updates settings' do
expect(page).to have_content "Application settings saved successfully"
end
scenario 'Change Spam settings' do
it 'Change Spam settings' do
page.within('.as-spam') do
check 'Enable reCAPTCHA'
fill_in 'reCAPTCHA Site Key', with: 'key'
......@@ -277,7 +277,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.unique_ips_limit_per_user).to eq(15)
end
scenario 'Configure web terminal' do
it 'Configure web terminal' do
page.within('.as-terminal') do
fill_in 'Max session time', with: 15
click_button 'Save changes'
......@@ -287,7 +287,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.terminal_max_session_time).to eq(15)
end
scenario 'Enable outbound requests' do
it 'Enable outbound requests' do
page.within('.as-outbound') do
check 'Allow requests to the local network from hooks and services'
click_button 'Save changes'
......@@ -297,7 +297,7 @@ feature 'Admin updates settings' do
expect(Gitlab::CurrentSettings.allow_local_requests_from_hooks_and_services).to be true
end
scenario 'Change Slack Notifications Service template settings' do
it 'Change Slack Notifications Service template settings' do
first(:link, 'Service Templates').click
click_link 'Slack notifications'
fill_in 'Webhook', with: 'http://localhost'
......@@ -321,7 +321,7 @@ feature 'Admin updates settings' do
expect(find('#service_push_channel').value).to eq '#test_channel'
end
scenario 'Change Keys settings' do
it 'Change Keys settings' do
page.within('.as-visibility-access') do
select 'Are forbidden', from: 'RSA SSH keys'
select 'Are allowed', from: 'DSA SSH keys'
......
require 'rails_helper'
feature 'Admin uses repository checks' do
describe 'Admin uses repository checks' do
include StubENV
before do
......@@ -8,7 +8,7 @@ feature 'Admin uses repository checks' do
sign_in(create(:admin))
end
scenario 'to trigger a single check' do
it 'to trigger a single check' do
project = create(:project)
visit_admin_project_page(project)
......@@ -19,7 +19,7 @@ feature 'Admin uses repository checks' do
expect(page).to have_content('Repository check was triggered')
end
scenario 'to see a single failed repository check', :js do
it 'to see a single failed repository check', :js do
project = create(:project)
project.update_columns(
last_repository_check_failed: true,
......@@ -32,7 +32,7 @@ feature 'Admin uses repository checks' do
end
end
scenario 'to clear all repository checks', :js do
it 'to clear all repository checks', :js do
visit admin_application_settings_path
expect(RepositoryCheck::ClearWorker).to receive(:perform_async)
......
require 'spec_helper'
feature 'Contributions Calendar', :js do
describe 'Contributions Calendar', :js do
let(:user) { create(:user) }
let(:contributed_project) { create(:project, :public, :repository) }
let(:issue_note) { create(:note, project: contributed_project) }
......
......@@ -16,7 +16,7 @@ describe "Container Registry", :js do
end
context 'when there are no image repositories' do
scenario 'user visits container registry main page' do
it 'user visits container registry main page' do
visit_container_registry
expect(page).to have_content 'No container images'
......@@ -29,13 +29,13 @@ describe "Container Registry", :js do
project.container_repositories << container_repository
end
scenario 'user wants to see multi-level container repository' do
it 'user wants to see multi-level container repository' do
visit_container_registry
expect(page).to have_content('my/image')
end
scenario 'user removes entire container repository' do
it 'user removes entire container repository' do
visit_container_registry
expect_any_instance_of(ContainerRepository)
......@@ -44,7 +44,7 @@ describe "Container Registry", :js do
click_on(class: 'js-remove-repo')
end
scenario 'user removes a specific tag from container repository' do
it 'user removes a specific tag from container repository' do
visit_container_registry
find('.js-toggle-repo').click
......
require 'spec_helper'
feature 'Cycle Analytics', :js do
describe 'Cycle Analytics', :js do
let(:user) { create(:user) }
let(:guest) { create(:user) }
let(:project) { create(:project, :repository) }
......
require 'spec_helper'
feature 'Dashboard > Activity' do
describe 'Dashboard > Activity' do
let(:user) { create(:user) }
before do
......@@ -66,7 +66,7 @@ feature 'Dashboard > Activity' do
wait_for_requests
end
scenario 'user should see all events' do
it 'user should see all events' do
within '.content_list' do
expect(page).to have_content('pushed new branch')
expect(page).to have_content('joined')
......@@ -77,7 +77,7 @@ feature 'Dashboard > Activity' do
end
end
scenario 'user should see only pushed events' do
it 'user should see only pushed events' do
click_link('Push events')
wait_for_requests
......@@ -90,7 +90,7 @@ feature 'Dashboard > Activity' do
end
end
scenario 'user should see only merged events' do
it 'user should see only merged events' do
click_link('Merge events')
wait_for_requests
......@@ -103,7 +103,7 @@ feature 'Dashboard > Activity' do
end
end
scenario 'user should see only issues events' do
it 'user should see only issues events' do
click_link('Issue events')
wait_for_requests
......@@ -117,7 +117,7 @@ feature 'Dashboard > Activity' do
end
end
scenario 'user should see only comments events' do
it 'user should see only comments events' do
click_link('Comments')
wait_for_requests
......@@ -130,7 +130,7 @@ feature 'Dashboard > Activity' do
end
end
scenario 'user should see only joined events' do
it 'user should see only joined events' do
click_link('Team')
wait_for_requests
......@@ -143,7 +143,7 @@ feature 'Dashboard > Activity' do
end
end
scenario 'user see selected event after page reloading' do
it 'user see selected event after page reloading' do
click_link('Push events')
wait_for_requests
visit activity_dashboard_path
......
require 'spec_helper'
feature 'Tooltips on .timeago dates', :js do
describe 'Tooltips on .timeago dates', :js do
let(:user) { create(:user) }
let(:project) { create(:project, name: 'test', namespace: user.namespace) }
let(:created_date) { Date.yesterday.to_time }
......
require 'spec_helper'
feature 'Dashboard Groups page', :js do
describe 'Dashboard Groups page', :js do
let(:user) { create :user }
let(:group) { create(:group) }
let(:nested_group) { create(:group, :nested) }
......
require 'spec_helper'
feature 'Dashboard Issues filtering', :js do
describe 'Dashboard Issues filtering', :js do
include Spec::Support::Helpers::Features::SortingHelpers
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'Dashboard Merge Requests' do
describe 'Dashboard Merge Requests' do
include Spec::Support::Helpers::Features::SortingHelpers
include FilterItemSelectHelper
include ProjectForksHelper
......
require 'spec_helper'
feature 'Dashboard > milestone filter', :js do
describe 'Dashboard > milestone filter', :js do
include FilterItemSelectHelper
let(:user) { create(:user) }
......
require 'spec_helper'
feature 'Dashboard > Milestones' do
describe 'Dashboard > Milestones' do
describe 'as anonymous user' do
before do
visit dashboard_milestones_path
......
require 'spec_helper'
feature 'Project member activity', :js do
describe 'Project member activity', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public, name: 'x', namespace: user.namespace) }
......
require 'spec_helper'
feature 'Dashboard Projects' do
describe 'Dashboard Projects' do
let(:user) { create(:user) }
let(:project) { create(:project, :repository, name: 'awesome stuff') }
let(:project2) { create(:project, :public, name: 'Community project') }
......@@ -121,7 +121,7 @@ feature 'Dashboard Projects' do
visit dashboard_projects_path
end
scenario 'shows "Create merge request" button' do
it 'shows "Create merge request" button' do
expect(page).to have_content 'You pushed to feature'
within('#content-body') do
......
require 'spec_helper'
feature 'Dashboard shortcuts', :js do
describe 'Dashboard shortcuts', :js do
context 'logged in' do
before do
sign_in(create(:user))
visit root_dashboard_path
end
scenario 'Navigate to tabs' do
it 'Navigate to tabs' do
find('body').send_keys([:shift, 'I'])
check_page_title('Issues')
......@@ -31,7 +31,7 @@ feature 'Dashboard shortcuts', :js do
visit explore_root_path
end
scenario 'Navigate to tabs' do
it 'Navigate to tabs' do
find('body').send_keys([:shift, 'G'])
find('.nothing-here-block')
......
require 'rails_helper'
feature 'Dashboard > Todo target states' do
describe 'Dashboard > Todo target states' do
let(:user) { create(:user) }
let(:author) { create(:user) }
let(:project) { create(:project, :public) }
......@@ -9,7 +9,7 @@ feature 'Dashboard > Todo target states' do
sign_in(user)
end
scenario 'on a closed issue todo has closed label' do
it 'on a closed issue todo has closed label' do
issue_closed = create(:issue, state: 'closed')
create_todo issue_closed
visit dashboard_todos_path
......@@ -19,7 +19,7 @@ feature 'Dashboard > Todo target states' do
end
end
scenario 'on an open issue todo does not have an open label' do
it 'on an open issue todo does not have an open label' do
issue_open = create(:issue)
create_todo issue_open
visit dashboard_todos_path
......@@ -29,7 +29,7 @@ feature 'Dashboard > Todo target states' do
end
end
scenario 'on a merged merge request todo has merged label' do
it 'on a merged merge request todo has merged label' do
mr_merged = create(:merge_request, :simple, :merged, author: user)
create_todo mr_merged
visit dashboard_todos_path
......@@ -39,7 +39,7 @@ feature 'Dashboard > Todo target states' do
end
end
scenario 'on a closed merge request todo has closed label' do
it 'on a closed merge request todo has closed label' do
mr_closed = create(:merge_request, :simple, :closed, author: user)
create_todo mr_closed
visit dashboard_todos_path
......@@ -49,7 +49,7 @@ feature 'Dashboard > Todo target states' do
end
end
scenario 'on an open merge request todo does not have an open label' do
it 'on an open merge request todo does not have an open label' do
mr_open = create(:merge_request, :simple, author: user)
create_todo mr_open
visit dashboard_todos_path
......
require 'spec_helper'
feature 'Dashboard > User filters todos', :js do
describe 'Dashboard > User filters todos', :js do
let(:user_1) { create(:user, username: 'user_1', name: 'user_1') }
let(:user_2) { create(:user, username: 'user_2', name: 'user_2') }
......
require 'spec_helper'
feature 'Dashboard > User sorts todos' do
describe 'Dashboard > User sorts todos' do
let(:user) { create(:user) }
let(:project) { create(:project) }
......
require 'spec_helper'
feature 'Dashboard Todos' do
describe 'Dashboard Todos' do
let(:user) { create(:user) }
let(:author) { create(:user) }
let(:project) { create(:project, :public) }
......
require 'spec_helper'
feature 'Expand and collapse diffs', :js do
describe 'Expand and collapse diffs', :js do
let(:branch) { 'expand-collapse-diffs' }
let(:project) { create(:project, :repository) }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment