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
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-16 03:09:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-16 03:09:15 +0300
commite97635ea6c5bdb695188b3ad75edd5f5842387b4 (patch)
tree245f0bc7493683e3b061db3f7482505dd6c2fdf2 /spec
parent6505e8ec12b203dc380186e7eb6916397caca1f4 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/bin/feature_flag_spec.rb5
-rw-r--r--spec/graphql/types/achievements/achievement_type_spec.rb1
-rw-r--r--spec/lib/gitlab/ci/build/rules/rule/clause/if_spec.rb6
-rw-r--r--spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb7
-rw-r--r--spec/lib/gitlab/ci/pipeline/expression/lexeme/not_matches_spec.rb7
-rw-r--r--spec/requests/api/graphql/mutations/achievements/create_spec.rb7
-rw-r--r--spec/requests/api/projects_spec.rb21
-rw-r--r--spec/tooling/danger/stable_branch_spec.rb2
8 files changed, 31 insertions, 25 deletions
diff --git a/spec/bin/feature_flag_spec.rb b/spec/bin/feature_flag_spec.rb
index cce103965d3..d1e4be5be28 100644
--- a/spec/bin/feature_flag_spec.rb
+++ b/spec/bin/feature_flag_spec.rb
@@ -1,11 +1,10 @@
# frozen_string_literal: true
-require 'fast_spec_helper'
-require 'rspec-parameterized'
+require 'spec_helper'
load File.expand_path('../../bin/feature-flag', __dir__)
-RSpec.describe 'bin/feature-flag' do
+RSpec.describe 'bin/feature-flag', feature_category: :feature_flags do
using RSpec::Parameterized::TableSyntax
describe FeatureFlagCreator do
diff --git a/spec/graphql/types/achievements/achievement_type_spec.rb b/spec/graphql/types/achievements/achievement_type_spec.rb
index d8cd52f78d7..f967dc8e25e 100644
--- a/spec/graphql/types/achievements/achievement_type_spec.rb
+++ b/spec/graphql/types/achievements/achievement_type_spec.rb
@@ -12,7 +12,6 @@ RSpec.describe GitlabSchema.types['Achievement'], feature_category: :user_profil
name
avatar_url
description
- revokeable
created_at
updated_at
]
diff --git a/spec/lib/gitlab/ci/build/rules/rule/clause/if_spec.rb b/spec/lib/gitlab/ci/build/rules/rule/clause/if_spec.rb
index 31c7437cfe0..ebdb738f10b 100644
--- a/spec/lib/gitlab/ci/build/rules/rule/clause/if_spec.rb
+++ b/spec/lib/gitlab/ci/build/rules/rule/clause/if_spec.rb
@@ -1,10 +1,8 @@
# frozen_string_literal: true
-require 'fast_spec_helper'
-require 'support/helpers/stubbed_feature'
-require 'support/helpers/stub_feature_flags'
+require 'spec_helper'
-RSpec.describe Gitlab::Ci::Build::Rules::Rule::Clause::If do
+RSpec.describe Gitlab::Ci::Build::Rules::Rule::Clause::If, feature_category: :continuous_integration do
include StubFeatureFlags
subject(:if_clause) { described_class.new(expression) }
diff --git a/spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb b/spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb
index 47f172922a5..1a622000c1b 100644
--- a/spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/expression/lexeme/matches_spec.rb
@@ -1,11 +1,8 @@
# frozen_string_literal: true
-require 'fast_spec_helper'
-require 'support/helpers/stubbed_feature'
-require 'support/helpers/stub_feature_flags'
-require_dependency 're2'
+require 'spec_helper'
-RSpec.describe Gitlab::Ci::Pipeline::Expression::Lexeme::Matches do
+RSpec.describe Gitlab::Ci::Pipeline::Expression::Lexeme::Matches, feature_category: :continuous_integration do
include StubFeatureFlags
let(:left) { double('left') }
diff --git a/spec/lib/gitlab/ci/pipeline/expression/lexeme/not_matches_spec.rb b/spec/lib/gitlab/ci/pipeline/expression/lexeme/not_matches_spec.rb
index 9e7ea3e4ea4..a60b00457fb 100644
--- a/spec/lib/gitlab/ci/pipeline/expression/lexeme/not_matches_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/expression/lexeme/not_matches_spec.rb
@@ -1,11 +1,8 @@
# frozen_string_literal: true
-require 'fast_spec_helper'
-require 'support/helpers/stubbed_feature'
-require 'support/helpers/stub_feature_flags'
-require_dependency 're2'
+require 'spec_helper'
-RSpec.describe Gitlab::Ci::Pipeline::Expression::Lexeme::NotMatches do
+RSpec.describe Gitlab::Ci::Pipeline::Expression::Lexeme::NotMatches, feature_category: :continuous_integration do
include StubFeatureFlags
let(:left) { double('left') }
diff --git a/spec/requests/api/graphql/mutations/achievements/create_spec.rb b/spec/requests/api/graphql/mutations/achievements/create_spec.rb
index 1e2f0dd777f..3082629d40f 100644
--- a/spec/requests/api/graphql/mutations/achievements/create_spec.rb
+++ b/spec/requests/api/graphql/mutations/achievements/create_spec.rb
@@ -13,15 +13,13 @@ RSpec.describe Mutations::Achievements::Create, feature_category: :user_profile
let(:mutation) { graphql_mutation(:achievements_create, params) }
let(:name) { 'Name' }
let(:description) { 'Description' }
- let(:revokeable) { false }
let(:avatar) { fixture_file_upload("spec/fixtures/dk.png") }
let(:params) do
{
namespace_id: group.to_global_id,
name: name,
avatar: avatar,
- description: description,
- revokeable: revokeable
+ description: description
}
end
@@ -70,8 +68,7 @@ RSpec.describe Mutations::Achievements::Create, feature_category: :user_profile
expect(graphql_data_at(:achievements_create, :achievement)).to match a_hash_including(
'name' => name,
'namespace' => a_hash_including('id' => group.to_global_id.to_s),
- 'description' => description,
- 'revokeable' => revokeable
+ 'description' => description
)
end
end
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index b86aa04439e..9a481c524e2 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -2265,7 +2265,7 @@ RSpec.describe API::Projects, feature_category: :projects do
context 'when user is the owner of the project' do
let(:request) { get api("/projects/#{project.id}/share_locations", user), params: params }
- let(:params) {}
+ let(:params) { {} }
before do
project.add_owner(user)
@@ -4733,6 +4733,25 @@ RSpec.describe API::Projects, feature_category: :projects do
expect(response).to have_gitlab_http_status(:created)
end
+ context 'when requesting prune' do
+ it 'triggers a prune' do
+ expect(Repositories::HousekeepingService).to receive(:new).with(project, :prune).and_return(housekeeping)
+ expect(housekeeping).to receive(:execute).once
+
+ post api("/projects/#{project.id}/housekeeping", user), params: { task: :prune }
+
+ expect(response).to have_gitlab_http_status(:created)
+ end
+ end
+
+ context 'when requesting an unsupported task' do
+ it 'responds with bad_request' do
+ expect(Repositories::HousekeepingService).not_to receive(:new)
+ post api("/projects/#{project.id}/housekeeping", user), params: { task: :unsupported_task }
+ expect(response).to have_gitlab_http_status(:bad_request)
+ end
+ end
+
context 'when housekeeping lease is taken' do
it 'returns conflict' do
expect(housekeeping).to receive(:execute).once.and_raise(Repositories::HousekeepingService::LeaseTaken)
diff --git a/spec/tooling/danger/stable_branch_spec.rb b/spec/tooling/danger/stable_branch_spec.rb
index c131346d7d6..9eee077d493 100644
--- a/spec/tooling/danger/stable_branch_spec.rb
+++ b/spec/tooling/danger/stable_branch_spec.rb
@@ -206,7 +206,7 @@ RSpec.describe Tooling::Danger::StableBranch, feature_category: :delivery do
context 'when not an applicable version' do
let(:target_branch) { '14-9-stable-ee' }
- it_behaves_like 'with a warning', described_class::VERSION_ERROR_MESSAGE
+ it_behaves_like 'with a warning', described_class::VERSION_WARNING_MESSAGE
end
context 'when the version API request fails' do