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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/specs/features/api/3_create/repository/project_archive_compare_spec.rb')
-rw-r--r--qa/qa/specs/features/api/3_create/repository/project_archive_compare_spec.rb21
1 files changed, 12 insertions, 9 deletions
diff --git a/qa/qa/specs/features/api/3_create/repository/project_archive_compare_spec.rb b/qa/qa/specs/features/api/3_create/repository/project_archive_compare_spec.rb
index 3ad56e21ad4..e66e8f8c9d4 100644
--- a/qa/qa/specs/features/api/3_create/repository/project_archive_compare_spec.rb
+++ b/qa/qa/specs/features/api/3_create/repository/project_archive_compare_spec.rb
@@ -5,33 +5,36 @@ require 'securerandom'
require 'digest'
module QA
- context 'Create' do
+ RSpec.describe 'Create' do
describe 'Compare archives of different user projects with the same name and check they\'re different' do
include Support::Api
+ let(:project_name) { "project-archive-download-#{SecureRandom.hex(8)}" }
- before do
- @project_name = "project-archive-download-#{SecureRandom.hex(8)}"
- @archive_types = %w(tar.gz tar.bz2 tar zip)
- @users = {
+ let(:archive_types) { %w(tar.gz tar.bz2 tar zip) }
+
+ let(:users) do
+ {
user1: { username: Runtime::Env.gitlab_qa_username_1, password: Runtime::Env.gitlab_qa_password_1 },
user2: { username: Runtime::Env.gitlab_qa_username_2, password: Runtime::Env.gitlab_qa_password_2 }
}
+ end
- @users.each do |_, user_info|
+ before do
+ users.each do |_, user_info|
user_info[:user] = Resource::User.fabricate_or_use(user_info[:username], user_info[:password])
user_info[:api_client] = Runtime::API::Client.new(:gitlab, user: user_info[:user])
user_info[:api_client].personal_access_token
- user_info[:project] = create_project(user_info[:user], user_info[:api_client], @project_name)
+ user_info[:project] = create_project(user_info[:user], user_info[:api_client], project_name)
end
end
it 'download archives of each user project then check they are different' do
archive_checksums = {}
- @users.each do |user_key, user_info|
+ users.each do |user_key, user_info|
archive_checksums[user_key] = {}
- @archive_types.each do |type|
+ archive_types.each do |type|
archive_path = download_project_archive_via_api(user_info[:api_client], user_info[:project], type).path
archive_checksums[user_key][type] = Digest::MD5.hexdigest(File.read(archive_path))
end