diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-14 12:10:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-14 12:10:35 +0000 |
commit | d378fdaa60adb7217e3fc798580ad206127728d5 (patch) | |
tree | 9cb715513dd4d4197f76b2908458551940b0a094 /spec/support | |
parent | 7b69070a7468c4a9b6fe0ed7fbf1b3f2b58434e0 (diff) | |
download | gitlab-ce-d378fdaa60adb7217e3fc798580ad206127728d5.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/helpers/cycle_analytics_helpers.rb | 4 | ||||
-rw-r--r-- | spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb | 16 |
2 files changed, 14 insertions, 6 deletions
diff --git a/spec/support/helpers/cycle_analytics_helpers.rb b/spec/support/helpers/cycle_analytics_helpers.rb index ae0f48fbe47..3ec52f8c832 100644 --- a/spec/support/helpers/cycle_analytics_helpers.rb +++ b/spec/support/helpers/cycle_analytics_helpers.rb @@ -71,12 +71,12 @@ module CycleAnalyticsHelpers save_value_stream(custom_value_stream_name) end - def wait_for_stages_to_load(selector = '.js-path-navigation') + def wait_for_stages_to_load(selector = '[data-testid="vsa-path-navigation"]') expect(page).to have_selector selector wait_for_requests end - def select_group(target_group, ready_selector = '.js-path-navigation') + def select_group(target_group, ready_selector = '[data-testid="vsa-path-navigation"]') visit group_analytics_cycle_analytics_path(target_group) wait_for_stages_to_load(ready_selector) diff --git a/spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb b/spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb index d4801af4980..acbcf4f7f3d 100644 --- a/spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/helm_packages_shared_examples.rb @@ -36,15 +36,23 @@ RSpec.shared_examples 'process helm service index request' do |user_type, status expect(yaml_response.keys).to contain_exactly('apiVersion', 'entries', 'generated', 'serverInfo') expect(yaml_response['entries']).to be_a(Hash) - expect(yaml_response['entries'].keys).to contain_exactly(package.name) - expect(yaml_response['serverInfo']).to eq({ 'contextPath' => "/api/v4/projects/#{project.id}/packages/helm" }) + expect(yaml_response['entries'].keys).to contain_exactly(package.name, package2.name) + expect(yaml_response['serverInfo']).to eq({ 'contextPath' => "/api/v4/projects/#{project_id}/packages/helm" }) package_entry = yaml_response['entries'][package.name] - expect(package_entry.length).to eq(2) + expect(package_entry.length).to eq(1) expect(package_entry.first.keys).to contain_exactly('name', 'version', 'apiVersion', 'created', 'digest', 'urls') expect(package_entry.first['digest']).to eq('fd2b2fa0329e80a2a602c2bb3b40608bcd6ee5cf96cf46fd0d2800a4c129c9db') expect(package_entry.first['urls']).to eq(["charts/#{package.name}-#{package.version}.tgz"]) + + package_entry = yaml_response['entries'][package2.name] + + expect(package_entry.length).to eq(1) + expect(package_entry.first.keys).to contain_exactly('name', 'version', 'apiVersion', 'created', 'digest', 'urls', 'description') + expect(package_entry.first['digest']).to eq('file2') + expect(package_entry.first['description']).to eq('hello from stable channel') + expect(package_entry.first['urls']).to eq(['charts/filename2.tgz']) end end end @@ -196,7 +204,7 @@ end RSpec.shared_examples 'rejects helm access with unknown project id' do context 'with an unknown project' do - let(:project) { OpenStruct.new(id: 1234567890) } + let(:project_id) { 1234567890 } context 'as anonymous' do it_behaves_like 'rejects helm packages access', :anonymous, :unauthorized |