diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-24 15:09:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-24 15:09:00 +0000 |
commit | c282dba898a4cb0645f88579339502a4e3778727 (patch) | |
tree | 94a6457ce4438e085c9ae43bc51a2b5a29787bf2 /spec/features | |
parent | 2c2dd5e36c4ed5f09f488be288882d98f9124d12 (diff) | |
download | gitlab-ce-c282dba898a4cb0645f88579339502a4e3778727.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
4 files changed, 48 insertions, 8 deletions
diff --git a/spec/features/profiles/password_spec.rb b/spec/features/profiles/password_spec.rb index 8c0c426f689..9dc96080732 100644 --- a/spec/features/profiles/password_spec.rb +++ b/spec/features/profiles/password_spec.rb @@ -63,7 +63,7 @@ describe 'Profile > Password' do visit edit_profile_password_path - expect(page).to have_gitlab_http_status(404) + expect(page).to have_gitlab_http_status(:not_found) end end @@ -73,7 +73,7 @@ describe 'Profile > Password' do it 'renders 404' do visit edit_profile_password_path - expect(page).to have_gitlab_http_status(404) + expect(page).to have_gitlab_http_status(:not_found) end end end diff --git a/spec/features/projects/badges/coverage_spec.rb b/spec/features/projects/badges/coverage_spec.rb index dd51eac9be1..d17588bb7b4 100644 --- a/spec/features/projects/badges/coverage_spec.rb +++ b/spec/features/projects/badges/coverage_spec.rb @@ -54,7 +54,7 @@ describe 'test coverage badge' do it 'user requests test coverage badge image' do show_test_coverage_badge - expect(page).to have_gitlab_http_status(404) + expect(page).to have_gitlab_http_status(:not_found) end end diff --git a/spec/features/projects/settings/registry_settings_spec.rb b/spec/features/projects/settings/registry_settings_spec.rb index 89da9d1b996..1a1940f6efb 100644 --- a/spec/features/projects/settings/registry_settings_spec.rb +++ b/spec/features/projects/settings/registry_settings_spec.rb @@ -4,20 +4,26 @@ require 'spec_helper' describe 'Project > Settings > CI/CD > Container registry tag expiration policy', :js do let(:user) { create(:user) } - let(:project) { create(:project, namespace: user.namespace) } + let(:project) { create(:project, namespace: user.namespace, container_registry_enabled: container_registry_enabled) } + let(:container_registry_enabled) { true } + + before do + sign_in(user) + stub_container_registry_config(enabled: true) + stub_feature_flags(registry_retention_policies_settings: true) + end context 'as owner' do before do - sign_in(user) visit project_settings_ci_cd_path(project) end - it 'section is available' do + it 'shows available section' do settings_block = find('#js-registry-policies') expect(settings_block).to have_text 'Container Registry tag expiration policy' end - it 'Save expiration policy submit the form' do + it 'saves expiration policy submit the form' do within '#js-registry-policies' do within '.card-body' do find('#expiration-policy-toggle button:not(.is-disabled)').click @@ -34,4 +40,38 @@ describe 'Project > Settings > CI/CD > Container registry tag expiration policy' expect(toast).to have_content('Expiration policy successfully saved.') end end + + context 'when registry is disabled' do + before do + stub_container_registry_config(enabled: false) + visit project_settings_ci_cd_path(project) + end + + it 'does not exists' do + expect(page).not_to have_selector('#js-registry-policies') + end + end + + context 'when container registry is disabled on project' do + let(:container_registry_enabled) { false } + + before do + visit project_settings_ci_cd_path(project) + end + + it 'does not exists' do + expect(page).not_to have_selector('#js-registry-policies') + end + end + + context 'when feature flag is disabled' do + before do + stub_feature_flags(registry_retention_policies_settings: false) + visit project_settings_ci_cd_path(project) + end + + it 'does not exists' do + expect(page).not_to have_selector('#js-registry-policies') + end + end end diff --git a/spec/features/projects/tags/user_views_tags_spec.rb b/spec/features/projects/tags/user_views_tags_spec.rb index bc570f502bf..7b49b0d0f65 100644 --- a/spec/features/projects/tags/user_views_tags_spec.rb +++ b/spec/features/projects/tags/user_views_tags_spec.rb @@ -7,7 +7,7 @@ describe 'User views tags', :feature do it do visit project_tags_path(project, format: :atom) - expect(page).to have_gitlab_http_status(200) + expect(page).to have_gitlab_http_status(:ok) end end |